Occasionally I will run in to issues with 64-bit compiled applications calling 32-bit dependencies. In this case, there were several applications compiled in Visual Studio as “Any CPU”. This indicates the application will take on the form of which ever architecture it is running on, either 32-bit or 64-bit. In this case, the 64-bit apps were making API calls to Adobe Reader which is a 32-bit application. The calls were working, but leaving the Adobe Reader open on the console waiting for user input. The app was suppose to open the PDF document, do a Save As, then close the Adobe Reader. Forcing the .NET executables to 32-bit fixed the issue. Here is how:
Run the corflags.exe utility which is included with the Windows SDK.
Syntax: corflags.exe <path_to_exe> /32BIT+
Run a quick sanity check to ensure it took:
Syntax: corflags.exe <path_to_exe>
You should get something like this:
Version : v2.0.50727
CLR Header: 2.5
PE : PE32
CorFlags : 3
ILONLY : 1
32BIT : 1
Signed : 0
Another way to verify the app is in 32-bit mode is to check Task Manager. If you see a *32 next to the application name, it is obviously running in 32-bit mode.
No comments:
Post a Comment