Product: PDFNet.dll
Product Version: 6.10.47.952
Please give a brief summary of your issue:
On Windows 11, using Visual Studio 22 (17.7.0)
When I run the Web Application, I received the following error:
Could not load file or assembly ‘PDFNet, Version=6.10.47.952, Culture=neutral, PublicKeyToken=45663c462b939c60’ or one of its dependencies. The system cannot find the file specified.
Could not load file or assembly ‘PDFNet’ 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.
In Visual Studio, go to Tools → Options → Project and Solutions → Web Project:
Uncheck “Use the 64 bit version of the IIS Express for Web Sites and projects”
Exception Details: System.IO.FileNotFoundException: Could not load file or assembly ‘PDFNet.DLL’ or one of its dependencies. The specified module could not be found.
When the option is checked, I receive the following:
Exception Details: System.BadImageFormatException: Could not load file or assembly ‘PDFNet’ or one of its dependencies. An attempt was made to load a program with an incorrect format.
In IIS, it does not matter if “Enable 32-bit” is set to true or false
In Visual Studio, all of the projects are build for “Any CPU”.
Now, here is the catch, in Windows 10, same version of Visual Studios 2022, when you uncheck “Use the 64 bit version of the IIS Express for Web Sites and projects”. Everything works prefectly.
What config adjustments are required to get this work in Windows 11? Does the PDFNet verison need to upgrade in order for it work in Windows 11?
Thank you