Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

System.IO.Packaging

People also ask

What is io packaging?

IO. Packaging classes to store and optionally protect any type or number of data files in a single efficient-to-access container. For more information, see the Open Packaging Conventions (OPC) specification.

What is package c#?

Packages are used in Java in order to prevent naming conflicts, to control access, to make searching/locating and usage of classes, interfaces, enumerations and annotations easier, etc.

What are packages in. net?

NET are created, hosted, and consumed, and provides the tools for each of those roles. Put simply, a NuGet package is a single ZIP file with the . nupkg extension that contains compiled code (DLLs), other files related to that code, and a descriptive manifest that includes information like the package's version number.


According to a user comment on this MSDN page, you have to add a reference to the WindowsBase .Net library.


For a C# solution in Visual Studio 2010 with .NET 4.0:

  1. In your project's Solution Explorer, right-click on References and select Add References from the context menu.
  2. Select Assemblies in the left-hand pane, then click the Browse button next to the File name field near the botton of the pane.
  3. Browse to .NET 4.0 reference assemblies and select WindowsBase.dll. For example, on my machine (Windows 7, 64-bit) the complete path is:

C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\WindowsBase.dll

Save the solution (especially if you're compiling from the command-line with MSBuild) and you should now be able to add the using System.IO.Packaging directive to the top of your .cs file without an error appearing.


System.IO.Packaging is a namespace, not a reference. Most (all?) of the classes within the namespace, such as ZipPackage, are deployed in WindowsBase.dll.

Make sure you have a reference to WindowsBase.dll - if you do, you can just add: using System.IO.Packaging; to your .cs files, and you'll be fine.

Note that you can see this in the documentation for any class on MSDN. For example, in ZipPackage, it lists:

Namespace:  System.IO.Packaging
Assembly:  WindowsBase (in WindowsBase.dll)

We can add WindowsBase.dll in Dot Net framework 3.5 as well. I am using XP machine and Path for WindowsBase.dll is

C:\Program Files\Reference Assemblies\Microsoft\Framework\.NETFramework\v3.5\Profile\Client\WindowsBase.dll

Example for using System.IO.packaging is given here -

Using System.IO.Packaging to generate a ZIP file


The System.IO.Packaging namespace is provided by WindowsBase. When you add a reference, add WindowsBase as the reference instead of trying to find System.IO.Packaging.


You need to add a reference to the WindowsBase.dll. System.IO.Packaging is located in there.

See this article for more details:

http://msdn.microsoft.com/en-us/library/system.io.packaging.package.aspx