How to use Process Monitor to determine which DLL throws a BadImageFormatException

I have a great web application that should work in a 64 bit process. However, when I set โ€œEnable 32-bit applicationsโ€ to False in my application pool, I get the following error trying to start the application in IE:

is not a valid Win32 application. (Exception from HRESULT: 0x800700C1)

The application name is missing at the beginning of the error message, i.e. I did not lose it during copy and paste.

I am advised to use Process Monitor to determine which application / DLL loading is actually causing the error, but I do not know where to start. Can anyone advise?

EDIT: I tried filtering Process Monitor only on w3wp.exe and only on the file system and processes, but just trying to go to the root URL gives 34012 events.

+4
source share
2 answers

Create a console application that is built for x64 only and uses it to dynamically load the entire referenced DLL, one at a time, with console output between loads. When the console application does not load one of the DLLs, you will know which one is.

+1
source

I assume this is an ASP.Net application. Have you installed your main Target Platform web project on x86.

You can find the parameter in Project Properties | Build | Platform goal

Also, do any of your projects reference any third-party libraries? If so, did you know that these are 32-bit or 64-bit DLL files?

0
source

Source: https://habr.com/ru/post/1342828/


All Articles