"'AVIExporterClientMW' could not be loaded" in WebAPI IISExpress project

Hello,

I am trying to create a new .NET Framework 4.7.2 empty WebAPI project with the MilestoneSystems.VideoOS.Platform.SDK NuGet package from visual studio 2019 with IISExpress and I can’t get it to work.

Steps I have done to reproduce:

  1. Create new ASP.NET Web Application (.NET Framework) project.

2. Manage NuGet packages… and install MilestoneSystems.VideoOS.Platform.SDK in version 24.2.3

3. Do the workaround for Unmanaged DLLs in IIS applications not found explained here: https://doc.developer.milestonesys.com/html/index.html?base=gettingstarted/sdk_in_an_iis.html&tree=tree_search.html?search=iis

to set the Environment Variables to the bin folder of the site.

4. Restart the machine.

5. Run the project again from Visual Studio 2019 in IISExpress.

I also tried what people suggested here: https://developer.milestonesys.com/s/question/0D53X0000A5QWsDSQW/could-not-load-file-or-assembly-aviexporterclientmwdll-or-one-of-its-dependencies-the-specified-module-could-not-be-found

but it didn’t change anything.

Please advise me how to use the dll packages for a new Web Project.

Even though I am doing all of this and I still get the error:

Server Error in ‘/’ Application.

Could not load file or assembly ‘AVIExporterClientMW’ or one of its dependencies. An attempt was made to load a program with an incorrect format.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.BadImageFormatException: Could not load file or assembly ‘AVIExporterClientMW’ or one of its dependencies. An attempt was made to load a program with an incorrect format.

Full error added in attachment because of text size limit…

BadImageFormatException means that you are building 32 bit where you should be doing 64 bit. Try to look into this. This is a guess on my part skipping a lot of the information and focusing on the exception only. Let me know if my guess is correct.

Your direction was correct, we found out that there is a checkbox in the options of Visual Studio

“Use the 64 bit version of IIS Express for web sites and project”.

Without that checked even build with 64 bit didn’t help.

Only after we checked it, everything worked, even when the build was for Any CPU.

Thank you for your assistance.