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

“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=3.0.0.0, 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.

    1 Comment

  1. Ashwath Shetty
    February 9, 2016
    Reply

    Thanks for the post . IT worked

Leave A Reply

Your email address will not be published. Required fields are marked *

You May Also Like

This C# program calculates and displays an upper triangular matrix based on user input. Problem Statement: The program takes the...
This C# program serves as a demonstration of bitwise operators, which are fundamental operators used for manipulating individual bits in...
This C# program is designed to interchange or swap the columns of a matrix. A matrix is a two-dimensional array...