Wednesday, April 4, 2012

Start Development Web Server Using Powershell Inside Visual Studio 2010

I have a WCF service that is hosted in a Development Web Server (locally) that supports a SharePoint 2010 custom web application. It is a hassle to drive into large solutions to start the server, so I wrote a little script.

Here is the script that starts the Development Web Server (Cassini) inside Visual Studio 2010 using Powershell.

param(
 $rootpath,
 $port = 8383,
 $virtualpath = '/'
)

Kill -name WebDev.WebServer*;

& 'C:\Program Files (x86)\Common Files\microsoft shared\DevServer\10.0\WebDev.WebServer40.EXE' /path:"$rootpath" /port:$port /vpath:"$virtualpath "


Here is an easy copy and paste line that you can throw into a Powershell console or Package Manager Console inside Visual Studio 2010.

Kill -name WebDev.WebServer*;& 'C:\Program Files (x86)\Common Files\microsoft shared\DevServer\10.0\WebDev.WebServer40.EXE' /path:"C:\TFS\\Main\Source\" /port:8383 /vpath:"/";

No comments: