Re: How does asp.net 2.0 allocate port numbers on localhost
Efran Cobisi <[email protected]>
| Newsgroups | gmane.comp.windows.devel.dotnet.web |
|---|---|
| Organization | QBGROUP SpA |
| Message-ID | <[email protected]> |
Hi, It's NOT the ASP.Net development webserver that allocates different port to bind from times to times. Actually, the port number must be specified in its command line arguments or it defaults to port 80. My researchs show that it's Visual Studio 2005 that implements the process of choosing the right port to bind (in the already mentioned ephemeral port range) and launches the ASP.Net development webserver expliciting that port number. Fortunately, you could manually launch the ASP.Net development webserver specifing the tpc port you want to bind it to, or let Visual Studio 2005 takes care of this for you, using the "Start external program" switch of the web project properties dialog box. The syntax for doing this is: %WINDIR%\Microsoft.NET\Framework\v2.0.50727\WebDev.WebServer.EXE /port:80 /path:"<PHYSICAL PATH OF THE PROJECT>" /vpath:"<VIRTUAL PATH OF THE PROJECT>" Example (on my pc): C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\WebDev.WebServer.EXE /port:80 /path:"C:\Development\testWebServer" /vpath:"/testWebServer" Remember to manually expand the environment variable %WINDIR% if you place the command line inside the aforementioned VS2005 project property dialog box, because it doesn't do it automatically. This should solve your problem. HTH, Efran Cobisi, cobisi.com Manoj Aggarwal wrote: > I am using VS2005, But the problem with using IIS is that I have to enable > remote debugging which is not very comfortable one. Having a website on the > file system allows me to debug more easily and fast. What I want to know is > that "I should be able to fix the port number for my website, so that it > never keeps changing. Also I want to know how asp.net allocate the port > number to the web server". > > Thanks, > Manoj Aggarwal. > > -----Original Message----- > From: Discussion of building .NET applications targeted for the Web > [mailto:[email protected]] On Behalf Of Efran Cobisi > Sent: Thursday, November 23, 2006 01:49 PM > To: [email protected] > Subject: Re: [DOTNET-WEB] How does asp.net 2.0 allocate port numbers on > localhost > > Hi, > > Assuming you are using Visual Studio 2005, it could depends on the fact > that, for file system Web sites, whenever you "start" a web site it > launches the ASP.NET Development server, which could change the port it > binds to. I suggest you to configure your project as an IIS web site and > set it as the "server" in the start options dialog box; it should always > use the same - default - port. > See http://msdn2.microsoft.com/en-us/ms178730(vs.80).aspx for additional > infos. > > HTH, > > Efran Cobisi > > Manoj Aggarwal wrote: > >> Dear Friends, >> >> I am working on a project based on Webservices and windows forms. >> > My > >> problem is that when I open the solution, sometimes the webservices starts >> on a different port number. For instance: earlier my webservices >> > application > >> was running on localhost:1907 and next day I start it may run on >> localhost:1480. This becomes very problematic as I would have given the >> webreferences with port number 1907. And changing the port number for each >> and every webservice is a tedious task. Do any body have a solution to fix >> the localhost port number. Also I would like to know about how asp.net 2.0 >> deals with port numbers. >> >> Thanks, >> Manoj Aggarwal. >> >> -----Original Message----- >> From: Discussion of building .NET applications targeted for the Web >> [mailto:[email protected]] On Behalf Of Dean Cleaver >> Sent: Tuesday, November 14, 2006 03:07 AM >> To: [email protected] >> Subject: [DOTNET-WEB] And for another problem >> >> Completely different page this time (actually it's a UserControl, not a >> page) and it's taking about 1 minute to create each control to design >> the page. It's been going for about 30 minutes now at 50%CPU (hyper >> threaded, so that's all it can). >> >> Dino >> >> =================================== >> This list is hosted by DevelopMentor. http://www.develop.com >> >> View archives and manage your subscription(s) at >> > http://discuss.develop.com > >> =================================== >> This list is hosted by DevelopMentorR http://www.develop.com >> >> View archives and manage your subscription(s) at >> > http://discuss.develop.com > > > =================================== > This list is hosted by DevelopMentorR http://www.develop.com > > View archives and manage your subscription(s) at http://discuss.develop.com > > =================================== > This list is hosted by DevelopMentor® http://www.develop.com > > View archives and manage your subscription(s) at http://discuss.develop.com > =================================== This list is hosted by DevelopMentor® http://www.develop.com View archives and manage your subscription(s) at http://discuss.develop.com