Tagged: 64 bit

Determining 64bit or 32 bit .NET assemblies

I work on a 64 bit machine but frequently deploy to 32 bit machines. The code I work on though has native hooks so I always need to deploy assembly entry points at 32 bit. This means I am usually paranoid about the build configuration. However, sometimes things slip up and a 64 bit dll gets sent out or an entrypoint is built with ANY CPU set. Usually this is caught on our continuous build server with some cryptic reason for a unit test that should be working is actually failing.

When this happens, what you’ll get is a message like this:

Unhandled Exception: System.BadImageFormatException: Could not load file or assembly 'Some.dll' or one of its dependencies. An attempt was made to load a program with
 an incorrect format.
   at Test.Program.Run(Args args, Boolean fastStart)
   at Test.ProgramMain(String[] args) in Program.cs:line 36

The first thing I do here is to try and … Read more

Fixing “Calling LoadLibraryEx on ISAPI filter v4.0.30319 aspnet_filter.dll failed”
Calling LoadLibraryEx on ISAPI filter "C:\Windows\Microsoft.NET\Framework\v4.0.30319\\aspnet_filter.dll" failed

I ran into this adding a new site to my 64 bit machine, and because I haven’t had my morning coffee, I forgot to set “enable 32 bit applications” in the app pool.

If your code is built for 32 bit only (maybe you use mixed mode dll’s somewhere or call into native and can’t be 64 bit for whatever reason), make sure the app pool of your application is set to 32 bit mode. Otherwise, you get the very descriptive error shown above.

iis32bit.Read more