Monday, August 24, 2009 #

Running 64-bit Binary References in Visual Studio

Technorati Tags: ,,

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”

     useiis

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

    basicsettings_apppool

5) Go to the advanced properties of your app pool and make sure “Enable 32-bit Applications” is set to false

     advancedproperties_apppool

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.


posted @ Monday, August 24, 2009 9:02 PM | Feedback (1)  

404 Error When Running Web Applications in IIS 7

Technorati Tags: ,

Today I was getting an annoying 404 (page not found) on any Application in IIS 7 I created.  I was trying to run our .NET 3.5 web application project and I knew everything was setup right in terms of configuring the site in the IIS Manager.  I looked at my hosts file, everything I could think of.

I’d create an Application (right-click the default web site in IIS 7 and choose Create Application) manually as well as tried to create one through VS 2008 (in the web project properties, go to Web tab and select to use IIS and click the “Create Virtual Directory” button.  Both ways you can create an Application in IIS under whatever web site.

Anyway, after all the troubleshooting it just came down to the fact that I did not have the IIS 6 Metabase and IIS 6 Configuration Compatibility portions of IIS installed.  I figured I did not need them because they were “legacy IIS 6 stuff”.  Well you do need them if running localhost.  I guess usually I had installed as I never had this problem before, but probably this time around on this new system figured I did not need it.  Well I was wrong.

Honestly I think it’s just dumb that we need to enable a feature with something labeled “IIS 6” when we’re using IIS 7 and .NET 3.5 WAP projects in VS 2008.  It’s just weird.  MS what were you thinking?

So Make sure you install this when you enable IIS.

iis6  


posted @ Monday, August 24, 2009 8:43 PM | Feedback (0)