Cloud Training (Online)

“The type ‘System.IO.Packaging.Package’ is defined in an assembly that is not referenced.” Error

Today , when I was working with the Open Office XML 2.0 SDK and adding the reference to the DocumentFormat.OpenXML assembly file and tried to build the project , i got the below compiler error message.

“The type ‘System.IO.Packaging.Package’ is defined in an assembly that is not referenced. You must add a reference to assembly ‘WindowsBase, Version=, Culture=neutral, PublicKeyToken=31bf3856ad364e35’.”

The fix was really simple. Adding the Windows Base assembly to the project solved the problem.

If you are using, Visual Studio 2012, just search for the WindowsBase in the Assemblies -> Framework in the Add Reference Dialog.

Senthil Kumar B
Senthil Kumar is a former Microsoft MVP (Most Valuable Professional). He is a Co-Author of the book "Windows 10 Development Recipes using JavaScript and CSS" for Apress Publication. He is a technical presenter, blogger, mentor and a Geek.  Senthil is a regular speaker is various local user groups. He has presented at conferences like Great Indian Developer Summit (GIDS) & Microsoft DevCamps. You can reach out to him via his Twitter handle @isenthil.