Setting Up IIS for ASP.Net Web Applications On Windows 7
This week I spent some time deploying a Web application I developed using Microsoft Visual Web Developer 2010 Express (it’s free). For that, I installed Microsoft Internet Information Service (IIS) on my Windows 7 enterprise edition. This turned out pretty straight-forward: Control Panel – Programs – Turn Windows Features on or off. In the Windows Features dialog box, just locate the Internet Information Service and check on it. After a click on the OK button, the IIS (version/build is IIS 7.5.7600.16385) was installed.
But it didn’t work for my ASP.Net Web application. To run it, I had to go through extra steps. I figure I would probably set up an IIS server on other servers later, therefore better document it for future. To make it simple, I omitted the error messages and how I researched the issues. It would be great if you also find it helpful.
Lost VMs or Containers? Too Many Consoles? Too Slow GUI? Time to learn how to "Google" and manage your VMware and clouds in a fast and secure HTML5 App.
Here are extra steps after the default installation:
- By default, ASP.Net is not turned on. I had to go back to the Windows Features dialog box and click down the Internet Information Service – World Wide Web Services – Application Development Features. There are several items including ASP.Net. To make it simple, I just checked them all.
- Afterward, I got an issue with targetFramework value in the Web.config. My Web application defaults it to 4.0, but it’s not recognized. To fix that, open the IIS manager (just type in inetmgr upon clicking Start). Click on the Application Pools in the left side tree, then double click DefaultAppPool. In the Edit Application Pool dialog box, from the .Net Framework version dropdown list, pick .Net Framework v4.0.30319.
- It still didn’t work. It turned out that ASP.Net needs to be registered per this article. Running the following two commands should do the trick.
%windir%\Microsoft.NET\Framework\v4.0.30319\aspnet_regiis.exe -i %windir%\Microsoft.NET\Framework64\v4.0.30319\aspnet_regiis.exe –i
You need to change the path to the specific versions of .NET on your machine.