How to configure IIS 7 on 64-bit Windows 7 to run 32-bit .NET 4 C# code
How to configure IIS 7 on 64-bit Windows 7 to run 32-bit .NET 4 C# codeOld forum URL: forums.lhotka.net/forums/t/9038.aspx
JonStonecash posted on Friday, June 04, 2010
I am getting the error "Could not load file or assembly 'CN.NET.Authorization' or one of its dependencies. An attempt was made to load a program with an incorrect format." when I attempt to access my CSLA assemblies via WCF. I have marked all of my code as X86. I am using the ASP.NET V4.0 application pools; I have also tried the ASP.NET V4.0 Classic as well. I am using VS2010.
Everything works just fine when IIS is not involved.
What do I do to get IIS to "play nice" with my code?
JonStonecash replied on Friday, June 04, 2010
I figured this out with some help from my co-workers. You have to configure the IIS application pools to allow 32 bit code. here is how to do it:
- Bring up IIS Manager.
- Open up the tree on the left to the point where you can see the Application Pools.
- Click on the Application Pools. You will see a grid of the available application pools.
- Click on the application pool that you want to allow 32-bit code for.
- Select the "Advanced Setting..." link on the right-hand side of the display.
- Flip the "Enable 32-bit Applications" value to true.
- Say OK to everything.
- Repeat for any other app pools.
Copyright (c) Marimer LLC