I had an issue where we wanted to start including the 64-bit assemblies to our WAP project replacing the 32-bit references. I was getting errors during runtime stating that it could not find the 64-bit assemblies when trying to run the web site on my local Vista 64-bit PC. Yet if we added the 32-bit assemblies to the web project instead and then deployed to our 64-bit Server 2008 Development Server and then copied back over the 64-bit assemblies into the bin of our web project, the site ran fine.
There is one little problem that I was not aware of till now since we’re now using a lot more 64-bit processes these days. Visual Studio (in my case 2008) runs only a 32-bit built-in web server process. Personally I like using IIS instead anyway when debugging my ASP.NET apps. It’s truer to what a real environment is anyway rather than relying on the funky built-in web server which does some real weird things sometimes. So because the built-in web server in IIS is only 32-bit it’s not going to be able to run or find 64-bit assemblies therefore you’ll get runtime errors like this. So out goes the built-in web server option.
So I changed my web project to use IIS instead:
1) Go to the properties of your WAP project.
2) Web Tab. Select “Use Local IIS Server”
3) Click “Create Virtual Directory”. This will create a new Web Application automatically for you in IIS instead of having to create one from scratch yourself.
4) Now go to the app pool that your application is using. Go to its basic settings and make sure you are using “Classic” for the Managed Pipeline Mode
5) Go to the advanced properties of your app pool and make sure “Enable 32-bit Applications” is set to false
After this, I was good to go. I was able to attach the 64-bit assemblies and the site would run without any errors because it’s now running in a 64-bit process.
Print | posted on Monday, August 24, 2009 9:02 PM