Click here to Skip to main content
Click here to Skip to main content

Run ASP.NET Web Application from Command Prompt

By , 8 Mar 2011
 
Prize winner in Competition "Best ASP.NET article of March 2011"

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
.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
My Kinect Book : Kinect for Windows SDK Programming Guide

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.
Search this forum  
    Spacing  Noise  Layout  Per page   
GeneralWorked gr8memberkarthick19892 May '11 - 23:30 
Hi All,
 
Here is where i found WebDev.WebServer.EXE for VS2005
"C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727"
 
Maybe not relevant but just thought of sharing. Worked gr8 for me.
 
Thanks abhijit for cool tip,
Karthick A
GeneralRe: Worked gr8mvpAbhijit Jana3 May '11 - 1:19 
Cheers Mate !Thumbs Up | :thumbsup:
Cheers !
Abhijit Jana | My Blog | @Twitter | Daily .Net Tips


GeneralMy vote of 5memberkarthick19892 May '11 - 23:08 
Cool stuff..Thanks for sharing!!
Answer[My vote of 1] It does not work in Windows XP professional service pack 2memberrajneeshrai2 May '11 - 19:41 
It does not work in Windows XP professional service pack 2 :|
GeneralRe: [My vote of 1] It does not work in Windows XP professional service pack 2mvpAbhijit Jana2 May '11 - 19:53 
rajneeshrai wrote:
It does not work in Windows XP professional service pack 2

Which does not work in Windows XP SP2 ? What did you try ?
 
If this is not working for you, you should have asked your query first, instead of voting down, to prove something else.Suspicious | :suss:
Dude, this is community, where everyone either help each other or try to learn from each other. What I want to mean is, if you really want to learn out something, instead of voting 1, you should have try it on other system, and try to figure it out. Which is the first thing, as a normal developer does !
And. if you are talking about Command Prompt Tips, I specifically mentioned about "Windows 7"
Anyway, be specific what is not running ?
Cheers !
Abhijit Jana | My Blog | @Twitter | Daily .Net Tips


GeneralMy vote of 5mvpAbhishek Sur27 Apr '11 - 11:51 
Great work man...
 
Got my vote long ago. But nice to see my comment here too.
GeneralMy vote of 5memberAnkur\m/22 Apr '11 - 1:03 
Nice tip!
Can you just add a text version of Step 3. The image is too small to be seen or may be I have a very high resolution set. In any case, it will be very helpful.
Thanks! Smile | :)
General[My vote of 2] Whats the use in practical devmembertejinderjoshi20 Apr '11 - 22:38 
This looks to me just some RND and time pass. Wondering whats the use of this in practical life.
GeneralRe: [My vote of 2] Whats the use in practical devmvpAbhijit Jana21 Apr '11 - 22:32 
I thought to explain you what could be the use. But unfortunately found your account is just 1 day old Roll eyes | :rolleyes: and and which has been used for to down vote this article. Suspicious | :suss: Suspicious | :suss:
And, It was a blog post ! Smile | :)
Cheers !
Abhijit Jana | My Blog | @Twitter | Daily .Net Tips

 
modified on Friday, April 22, 2011 10:24 AM

GeneralRe: [My vote of 2] Whats the use in practical devmvpBrij21 Apr '11 - 23:13 
You are absolutely right Abhijit..
Cheers!!
Brij
Visit my Blog: http://brijbhushan.net


GeneralRe: [My vote of 2] Whats the use in practical devmembertejinderjoshi2 May '11 - 16:48 
Must be my account is one day old but definetly not to down vote you. Fact remains what is the use of running webserver via command prompt.
GeneralRe: [My vote of 2] Whats the use in practical devmvpAbhijit Jana2 May '11 - 19:47 
The fundamentals of the articles is totally based on, What is ASP.NET Development server, why there are two different type of ASP.NET Dev Server. The same ASP.NET Dev servers are runs from Visual Studio when you just Press F5. Then, where is the problem to look into how they really execute. What kind of information they really want before an asp.net development server start. And, I found this one was useful to many people.
There are few Tips and Tricks also shared with this article Smile | :) .
Hope this clears your doubt.
Cheers !
Abhijit Jana | My Blog | @Twitter | Daily .Net Tips


GeneralRe: [My vote of 2] Whats the use in practical devmvpKunal_Chowdhury22 Apr '11 - 3:59 
A developer in .Net field never asks such bogus queries.

Regards - Kunal Chowdhury | Microsoft MVP (Silverlight) | CodeProject MVP | Software Engineer
 
New Articles on Silverlight 5 Beta:  Debugging Data Bindings in XAML | Working with Multiple Click (ClickCount)

Appreciate your Vote and Feedback

GeneralRe: [My vote of 2] Whats the use in practical devmembertejinderjoshi2 May '11 - 16:47 
Oh really. Why will not developer such questions ?. Its simple where should i use it...
GeneralRe: [My vote of 2] Whats the use in practical devmvpAbhijit Jana2 May '11 - 20:00 
tejinderjoshi wrote:
Its simple where should i use it...

Tejinder,
If you read my reply, its more than where should I use it, it is how its works.
Thanks !
Cheers !
Abhijit Jana | My Blog | @Twitter | Daily .Net Tips


GeneralMy vote of 5memberAbhimanyu Kumar Vatsa19 Apr '11 - 4:03 
hey Abhi you are the best here...
GeneralMy vote of 5memberHaBiX19 Apr '11 - 1:11 
Great tip
GeneralMy vote of 5memberSChristmas12 Apr '11 - 2:02 
Good article
GeneralMy vote of 5memberGandalf - The White11 Apr '11 - 22:51 
Quite Handy!! Thumbs Up | :thumbsup:
Believe Yourself™

GeneralMy vote of 5mvpAbhinav S9 Apr '11 - 3:56 
Useful tip.
GeneralMy vote of 5memberSunasara Imdadhusen8 Apr '11 - 20:45 
Thumbs Up | :thumbsup:

sunaSaRa Imdadhusen
+91 99095 44184

GeneralMy vote of 4memberOscar N.18 Mar '11 - 8:37 
I'm looking for a way to run a web aplication as Executable ( as the telerik demos ,these also run the WebDev.WebServerX0.EXE ) any idea?
GeneralRe: My vote of 4memberHaBiX19 Apr '11 - 1:11 
i saw this first in telerik demo page.. and it had exe to startup server and browser after.
 
how to do it?
Process.Start("WebDev.Web..exe
GeneralSimply SuperbmemberDorababu74316 Mar '11 - 2:05 
Excellent Abhijit
GeneralMy vote of 5memberSChristmas11 Mar '11 - 8:41 
Nicely written AJ.

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

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