Tuesday, February 03, 2009

ASP.Net – How to manually start Web Dev Server (Cassini)

Cassini is the web developer server that is provided with Visual Studio (2005 & 2008) for debugging and testing ASP.Net websites. It is normally started by Visual Studio, whenever you attempt to debug an ASP.Net web-app.

Sometimes you just need to be able to run the web-dev server, without having to load up Visual Studio and here is a simple way to do that:

Create an empty bat file (I created mine on the desktop – and you will see why in a little bit…)

Copy and paste the following code into the bat file:

call "C:\Program Files\Microsoft Visual Studio 8\SDK\v2.0\Bin\sdkvars.bat" "C:\Program Files\Common Files\Microsoft Shared\DevServer\9.0\WebDev.WebServer.exe" /port:3900 /path:%1

Now, whenever you want to start the web-dev server, all you need to do is drag and drop the root folder of your web-site onto the bat file.

image

This will automatically start up Cassini.

image Right clicking on the web-dev icon and choosing “Open in web-browser”, will open up InternetExplorer, allowing you to view your web-site. image note: if you do not have default.aspx in your root folder, the web-browser will list all the contents of the folder, you can then manually click on the aspx file that you wish to see running within the dev-server.

No comments: