Fr.Usai
Fr.Usai

Reputation: 404

Unable to load assembly error deploying x64 ASP.NET web application

I have developed an ASP.NET web application consisting only of generic http handlers. I started on a x86 development machine tested locally using IISExpress, then deployed on a 32bit Windows 2003 Server with IIS6.0, and everything went well.

My company decided to update to an x64 environment in order to take advantage of some third party libraries that are optimized for 64bit environments, hence we switched to a 64bit Windows Server 2012 R2 std edition, but I'm having some troubles.

On my local machine, now switched to a x64 dev machine with platform target set to x64 everything goes well, but when deploying on the server I always get

System.BadImageFormatException

on the main assembly. Other part of the error message says that the assembly manager is loaded by

C:\Windows\Microsoft.NET\Framework\v4.0.30319\clr.dll

and it is executed with

C:\Windows\SysWOW64\inetsrv\w3wp.exe

Since SysWOW64 it is needed to run 32bit applications inside 64bit environments, it is possible that IIS server on the production machine is not enabled to run x64 web applications? If so what should I do to overcome this issue, knowing that I do not have direct access to the server.

Thank you.

Upvotes: 2

Views: 1437

Answers (1)

Kev
Kev

Reputation: 119806

The error and the paths:

C:\Windows\SysWOW64\inetsrv\w3wp.exe

and

C:\Windows\Microsoft.NET\Framework\v4.0.30319\clr.dll

...definitely prove that the production server you're deploying to is running its website application pools in 32 bit mode, or certainly yours anyway.

As a web hoster we do the same for a bunch of legacy reasons. Have a word and see if they'll flip it back to native 64 bit mode.

Upvotes: 1

Related Questions