Could not load file or assembly System.IO.Packaging

Home Forums Open-Xml-PowerTools Could not load file or assembly System.IO.Packaging

This topic contains 2 replies, has 2 voices, and was last updated by  jmhmaine 7 years, 9 months ago.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #4136

    jmhmaine
    Participant

    Hi:

    I got the latest OpenXmlPowerTools via NuGet and it installed the dependences OpenXMLSDK-MOT. But when I try running the code it throws an exception on:

    WmlDocument wmlTemplate = new WmlDocument(templateFileName);

    With the following information:

    An exception of type ‘System.IO.FileNotFoundException’ occurred in OpenXmlPowerTools.dll but was not handled in user code

    Additional information: Could not load file or assembly ‘System.IO.Packaging, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null’ or one of its dependencies. The system cannot find the file specified.

    I tried referencing WindowsBase.dll, but that didn’t resolve the issue. Another member of my development team was followed the same steps and it ran on his machine.

    Do I need to install anything else on my box?

    #4137

    Eric White
    Keymaster

    Hi,

    I’m afraid that I haven’t much to do these days with the NuGet package and dependencies. I didn’t create those, and haven’t used them. I’m sure they are great; I just don’t know much about them.

    Sorry I don’t have a better answer for you, but thought I’d let you know…

    Personally, I work directly from the github repos, and I’m afraid I am lazy and don’t try out the other various ways to use the Open-Xml-Sdk and Open-Xml-PowerTools. But I’m sure you can get it working 🙂

    Cheers, Eric

    #4138

    jmhmaine
    Participant

    I figured it out. In NuGet OpenXmlPowerTools has a dependency on OpenXMLSDK-MOT (>= 2.6.0) and pulls down v2.6.0 on install. What I did was to install the latest version of OpenXMLSDK-MOT which is v2.6.1. That caused the error to be thrown. But reverting back to v2.6.0 it worked.

    I’m guessing there is a reference I could add to the config file to allow it to use 2.6.1, so I’m at the latest version.

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.