CS0012: The type 'System.IO.Packaging.Package'

In this article , we will discuss  how to solve the below compilation error:

CS0012: 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 above error occurs when we use the OpenXml Packaging Library.


The Problem
When using OpenXml Packaging Library, .Net framework throws the following compilation error.

 CS0012: 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'.


Solutions

We can solve this problem just use below steps:-
Step1:-
We just need to go solution explorer and click the right button of mouse and chose the add reference.
Step2:-

In .Net tab we chose the WindowsBase library 
  
























For More:- 
CS0012: The type 'System.IO.Packaging.Package' CS0012: The type 'System.IO.Packaging.Package' Reviewed by NEERAJ SRIVASTAVA on 11:00:00 AM Rating: 5

No comments:

Powered by Blogger.