Webdev. webserver. EXE path under vs2008:
C: \ Program Files \ common files \ microsoft shared \ devserver \ 9.0 \ webdev. webserver. exe
On the Microsoft. NET platform, since Visual Studio 2005 and later Program You can compile and debug it in an environment without IIS. Each time you debug it, an Asp.net Development Server service is run. This service is similar to that of IIS. It can be said that it is a simplified version of IIS, although not as mature as IIS, it is enough to provide general IIS services. As a standalone service, it is still a good choice, this service is installed with webdev in Visual Studio 2005 or Visual Studio 2008 IDE. webserver. EXE file, which can be independent from webdev. webhost. dll can be used together with the Asp.net Development Server service.
The first method is to use the command prompt line:
1. Start -- run -- Enter cmd and press Enter.
2. Enter c: \ windows \ Microsoft in the command prompt line. net \ framework \ v2.0.50727 \ webdev. webserver/port: 38438/path: "C: \ Inetpub \ wwwroot \ myweb"/vpath: "/myweb"
Parameter description:
/Port:Specify the port number of the Asp.net development server to provide the service. The range is between 1 and.
/Path:Physical path for storing web programs.
/Vpath:(Optional) the default virtual path is "/".
3. Open IE and access your website through URL: http: // localhost: 38438/myweb ~! (How is it convenient ?)
Second, use winform (C #) to start the service.
The implementation method is as follows:
Private void runserver ()
{
PROCESS p = new process ();
P. startinfo. filename = "cmd.exe"; // set the program name
P. startinfo. arguments = "/C" + "C :\\ Windows \ Microsoft. net \ framework \ v2.0.50727 \ webdev. webserver/port: 38438/path: \ "C: \ Inetpub \ wwwroot \ myweb \"/vpath: \ "/myweb \""; // set the program line execution Parameters
P. startinfo. useshellexecute = false; // close shell usage
P. startinfo. redirectstandardinput = true; // redirect standard input
P. startinfo. redirectstandardoutput = true; // redirect standard output
P. startinfo. redirectstandarderror = true; // redirect error output
P. startinfo. createnowindow = true; // you can specify not to display a window.
P. Start ();
}
How can I use the Asp.net development server on a computer without Visual Studio 2005 or Visual Studio 2008 installed?
1. Copy the webdev. webserver. EXE file from the computer where Visual Studio 2005 or Visual Studio 2008 development environment is installed.
The vs2005 path is c: \ windows \ Microsoft. NET \ framework \ v2.0.50727 \ webdev.webserver.exe
The webdev. webserver. EXE file of vs2008 is in c: \ Program Files \ common files \ microsoft shared \ devserver \ 9.0 \ webdev. webserver. exe
2. copy only webdev. webserver. EXE and run Asp.net development server successfully on a computer without a development environment. A file called webdev. webhost. dll is also missing.
In the vs2005 environment, this file is stored in the c: \ windows \ Assembly \ gac_32 \ webdev. webhost \ 8.0.0.0 _ b03f5f7f11d50a3a path.
In the vs2008 environment, this file is saved in the c: \ windows \ Assembly \ gac_32 \ webdev. webhost \ 9.0.0.0 _ b03f5f7f11d50a3a path.
We need to copy the file from a computer with a development environment, and then copy the file to the Asp.net development server in the same path of the computer without the development environment.
To copy webdev. webhost. dll, you must run the doscommand in the command prompt line.
The procedure is as follows:
First: start -- run -- Enter cmd to bring up the command prompt line
Then run the doscommand copy c: \ windows \ Assembly \ gac_32 \ webdev. webhost \ 8.0.0.0 _ b03f5f7f11d50a3a \ webdev. webhost. dll c :\
Alternatively, run the doscommand copy c: \ windows \ Assembly \ gac_32 \ webdev. webhost \ 9.0.0.0 _ b03f5f7f11d50a3a \ webdev. webhost. dll c: \ in the command prompt line :\
In this way, the webdev. webhost. dll file is copied to the C root directory.
Finally, set webdev. webserver. EXE and webdev. webhost. copy the DLL file to a computer without a development environment installed, create a text file, copy the following content to the text file, and save it,
MD % SystemRoot % \ Assembly \ gac_32 \ webdev. webhost \ 8.0.0.0 _ b03f5f7f11d50a3a
Xcopy c: \ webdev. webhost. dll/Y % SystemRoot % \ Assembly \ gac_32 \ webdev. webhost \ 8.0.0.0 _ b03f5f7f11d50a3a
Change the file name of the text file to copy. bat, copy Copy. bat to the folder that saves webdev. webhost. dll, and run copy. bat.
OK. Now running webdev. webserver. EXE finds that the service can be started normally ~!
Simple ?? As a lightweight IIS Asp.net development server, it is very good ~!