Search code examples
asp.net-mvc64-bitiis-7.5

ASP .NET MVC on IIS 7.5, Windows 7 64 bit


I recently installed Windows 7, 64 bit on my machine to try my hands at 64 bit, the website always worked fine on 32 bit Windows 7 (VS 2008 was development environment).

This website is being developed on Visual Studio 2008 targeting .Net 3.5 fx and ASP .NET MVC1.

On this 64 bit machine, I installed VS 2010 and started using it for the website (we are looking at migrating to VS2010 and also planning to deploy our website on 64 bit machine). The website built perfectly fine on VS 2010.

But when I opened the website, it gave the following error.

Server Error in '/' Application.

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

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.

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

Here is the trace summary, for the above error. Trace, App Pool 32 bit false

I even tried running aspnet_regiis -i for .Net 2.0 in c:\windows\Microsoft .Net\Framework64.

Then, I also tried to set the app-pool in 32 bit by enabling 32 bit in advance settings for the app pool. But even that dint work for me.

The error I got after enabling 32 bit on App Pool

The specified module could not be found. (Exception from HRESULT: 0x8007007E)

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.

Exception Details: System.IO.FileNotFoundException: The specified module could not be found. (Exception from HRESULT: 0x8007007E)

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

The trace is similar to what I pasted above.

Any ideas on how can I solve this.


Solution

  • The settings that I mentioned in my question helped me to run my Webapp in 32bit mode on 64 bit OS.

    I dint change anything on my machine after I did as mentioned above. So my worker process runs in 32 bit mode now.

    I guess we need to look at replacing some of the unmanaged dll with managed ones.

    The benefits of running IIS in 32 bit on 64 bit will be that my IIS will get more address space and my in memory cache can be bigger on 64 bit.

    More details on benefits of running IIS in 32 bit on 64 bit here What are the pros and cons of running IIS as 32bit vs 64bit on a 64bit OS?