Click here to Skip to main content
Licence CPOL
First Posted 8 Mar 2011
Views 24,041
Bookmarked 46 times

Run ASP.NET Web Application from Command Prompt

By | 8 Mar 2011 | Technical Blog
Run ASP.NET Web Application from Command Prompt
Prize winner in Competition "Best ASP.NET article of March 2011"
A Technical Blog article. View original blog here.[^]

Visual Studio has its own integrated ASP.NET Runtime engine, which helps to run any ASP.NET web application within Visual Studio. While running application from Visual Studio, you must have seen a popup notification in System Tray (as shown in the below image), which is a notification of ASP.NET Development Server.

image

This ASP.NET Development Server is nothing but an executable file (WebDev.WebServer) which used by Visual Studio to execute you web application when it’s running in the context of Visual Studio. You can find the executable file at <\Program Files (x86)\Common Files\microsoft shared\DevServer\10.0>. This folder contains two different executables:

  • WebDev.WebServer20.EXE
  • WebDev.WebServer40.EXE

WebDev.WebServer20 is targeted to CLR 2.0, which means all the ASP.NET applications which are targeted till FW .NET 3.5 will be taken care by WebDev.WebServer20.EXE and WebDev.WebServer40.EXE for ASP.NET 4.0 based application.

Now, let’s see how we can use these executables to run an ASP.NET 4.0 application without using Visual Studio. Surprised smile

Step 1: Open the Command Prompt for “Program Files (x86)\Common Files\microsoft shared\DevServer\10.0”.

image

Easiest way to go there, type Cmd in the address bar (If you are using Win 7), this will directly open command prompt with exact path.

image

Pointing up Source for this cmd Tip: http://twitter.com/#!/pbrooks/status/35734806549495808 Thumbs up

Step 2: [Optional] Type WebDev.WebServer40 and Press Enter, this will open a popup window with the details of required parameter.

image

Step 3: If you are done with review, type below command in your command prompt:

image

Note: Port number should be valid and not be used by any other process and path is location of your published web apps.

Step 4: Once done, press Enter, you will see a pop up notification in system tray.

image

If you double click on that icon, you will get the below window of ASP.NET Development server, which is exactly the same notification window which we used to get when we run some ASP.NET application from Visual Studio.

image

This indicates your application is running now.

Step 4: Open IE > Type http://localhost:<portnumber>, you are there !Winking smile

image


Filed under: ASP.NET, Tips and Tricks, Visual Studio

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

About the Author

Abhijit Jana

Software Developer (Senior)

India India

Member

Follow on Twitter Follow on Twitter
.NET Consultant | Former Microsoft MVP - ASP.NET | CodeProject MVP, Mentor, Insiders| Technology Evangelist | Author | Speaker | Geek | Blogger | Husband
 
Blog : http://abhijitjana.net
Web Site : http://dailydotnettips.com
Twitter@AbhijitJana

Sign Up to vote   Poor Excellent
Add a reason or comment to your vote: x
Votes of 3 or less require a comment

Comments and Discussions

 
You must Sign In to use this message board. (secure sign-in)
 
Search this forum  
 FAQ
    Noise  Layout  Per page   
  Refresh
GeneralWorked gr8 Pinmemberkarthick198923:30 2 May '11  
GeneralRe: Worked gr8 PinmvpAbhijit Jana1:19 3 May '11  
GeneralMy vote of 5 Pinmemberkarthick198923:08 2 May '11  
Answer[My vote of 1] It does not work in Windows XP professional service pack 2 Pinmemberrajneeshrai19:41 2 May '11  
GeneralRe: [My vote of 1] It does not work in Windows XP professional service pack 2 PinmvpAbhijit Jana19:53 2 May '11  
GeneralMy vote of 5 PinmvpAbhishek Sur11:51 27 Apr '11  
GeneralMy vote of 5 PinmemberAnkur\m/1:03 22 Apr '11  
General[My vote of 2] Whats the use in practical dev Pinmembertejinderjoshi22:38 20 Apr '11  
GeneralRe: [My vote of 2] Whats the use in practical dev PinmvpAbhijit Jana22:32 21 Apr '11  
GeneralRe: [My vote of 2] Whats the use in practical dev PinmvpBrij23:13 21 Apr '11  
GeneralRe: [My vote of 2] Whats the use in practical dev Pinmembertejinderjoshi16:48 2 May '11  
GeneralRe: [My vote of 2] Whats the use in practical dev PinmvpAbhijit Jana19:47 2 May '11  
GeneralRe: [My vote of 2] Whats the use in practical dev PinmvpKunal_Chowdhury3:59 22 Apr '11  
GeneralRe: [My vote of 2] Whats the use in practical dev Pinmembertejinderjoshi16:47 2 May '11  
GeneralRe: [My vote of 2] Whats the use in practical dev PinmvpAbhijit Jana20:00 2 May '11  
GeneralMy vote of 5 PinmemberAbhimanyu Kumar Vatsa4:03 19 Apr '11  
GeneralMy vote of 5 PinmemberHaBiX1:11 19 Apr '11  
GeneralMy vote of 5 PinmemberSChristmas2:02 12 Apr '11  
GeneralMy vote of 5 PinmemberGandalf - The White22:51 11 Apr '11  
GeneralMy vote of 5 PinmvpAbhinav S3:56 9 Apr '11  
GeneralMy vote of 5 PinmemberSunasara Imdadhusen20:45 8 Apr '11  
GeneralMy vote of 4 PinmemberOscar N.8:37 18 Mar '11  
GeneralRe: My vote of 4 PinmemberHaBiX1:11 19 Apr '11  
GeneralSimply Superb PinmemberDorababu7432:05 16 Mar '11  
GeneralMy vote of 5 PinmemberSChristmas8:41 11 Mar '11  

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

Permalink | Advertise | Privacy | Mobile
Web03 | 2.5.120517.1 | Last Updated 8 Mar 2011
Article Copyright 2011 by Abhijit Jana
Everything else Copyright © CodeProject, 1999-2012
Terms of Use
Layout: fixed | fluid