Gunnar Peipman's ASP.NET blog

ASP.NET, C#, SharePoint, SQL Server and general software development topics.

Sponsors

News

 
 
 
DZone MVB

Links

Social

Visual Studio 2010 SP1 Beta supports IIS Express

Visual Studio 2010 SP1 Beta and ASP.NET MVC 3 RC2 were both announced today. I made a little test on one of my web applications to see how Visual Studio 2010 works with IIS Express. In this posting I will show you how to make your ASP.NET MVC 3 application work with IIS Express.

Installing new stuff

My old laptop installs Visual Studio 2010 SP1 BetaYou can install IIS Express using Web Platform Installer. It is not part of WebMatrix anymore and you can just install IIS Express without WebMatrix.

NB! You have to install IIS Express using Web Platform installer because IIS Express is not installed by SP1.

After installing Visual Studio 2010 SP1 Beta on my machine (it took a long-long-long time to install) I installed also ASP.NET MVC 3 RC2.

If you have Async CTP installed on your machine you have to uninstall it to get ASP.NET MVC 3 RC2 installed and run without problems.

Screenshot on right shows what kinf of horrors my old laptop had to survive to get all new stuff installer.

Setting IIS Express as server for web application

Now, when you right-click on some web project you should see new menu item in context menu – Use IIS Express….

VS2010 & IIS Express: Make web application use IIS Express

If you click on it you are asked for confirmation and if you say Yes then your web application is reconfigured to use IIS Express. After configuration you will see dialog box like this.

VS2010 & IIS Express: Web application URL on IIS Express

And you are done. You can run your application now.

Running web application

When you run your application it is run on IIS Express. You can see IIS Express icon on taskbar and when you click it you can open IIS Express settings.

VS2010 & IIS Express: Application running on IIS Express

If you closed your application in browser you can open it again from IIS Express icon.

Modifying IIS Express settings for web application

You can modify IIS Express settings for your application. Just open your project properties and move to Web tab.

VS2010 & IIS Express: Web application settings

IIS and IIS Express are using same settings. The difference is if you make check to Use IIS Express checkbox or not.

Switching back to Visual Studio Development Server

If you don’t want or you can’t use IIS Express for some reason you can easily switch back to Visual Studio Development Server. Just right-click on your web application project and select Use Visual Studio Development Server from context menu.

VS2010 & IIS Express: Use Visual Studio Development Server

Conclusion

IIS Express is more independent than full version of IIS and it can be also installed and run on machines where are very strict rules (some corporate and academic environments by example). IIS Express was previously part of WebMatrix package but now it is separate product and Visual Studio 2010 has very nice support for it thanks to SP1. You can easily make your web applications use IIS Express and if you want to switch back to development server it is also very easy.

Comments

No Comments