none
PackageManager crashing automation after upgrading from HCK to HLK .dlls RRS feed

  • Question

  • We use a tool that auto generates a big fancy excel spreadsheet and it all went boom when we tried to add in HLK files. I traced it down in the code to where I am assigning:PackageManager manager = new PackageManager("filename");

    At that point I get the error: +  $exception {"Could not load file or assembly 'Microsoft.Windows.Kits.Hardware.ObjectModel.Submission.Package, Version=10.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. An attempt was made to load a program with an incorrect format."} System.Exception {System.BadImageFormatException}

    I have the all the required .dlls referenced. If I remove the HLK versioned .dlls and put the HCK .dlls back, everything works fine. Anyone see this or have an idea what I can do to fix this?

    Tuesday, September 22, 2015 9:29 PM

All replies

  • Are you by any chance running from the 32-bit version of powershell?  If so, can you try running from the x64 version of powershell instead?

    This posting is provided "AS IS" with no warranties, and confers no rights

    Thursday, September 24, 2015 2:47 AM
  • I had the same problem / same error. I don't use PowerShell, but C#/.NET application.

    Problem occurs if I build for solution platform 'Any CPU'; if I build for 'x64', the problem doesn't occur.

    So, gerogek's suggestion might very well help.

    Friday, October 23, 2015 11:49 AM