Setting Built-In Web Server Port

Last post 12-15-2009 1:57 PM by vahidt_99. 14 replies.

Sort Posts:

  • Setting Built-In Web Server Port

    06-30-2004, 2:23 PM
    • Member
      85 point Member
    • jjct1
    • Member since 04-20-2004, 11:53 AM
    • Posts 17
    Is there a way to set the port number the built-in web server uses to run your web applications? It now seems to open a random open port. I want to configure what port the server uses. How can I do this?
  • Re: Setting Built-In Web Server Port

    06-30-2004, 3:49 PM
    • Member
      566 point Member
    • johndund
    • Member since 10-30-2002, 8:34 PM
    • Posts 112
    • AspNetTeam
    No, there is currently no way to do this through the UI. If your web site is part of a solution however, the port that is randomly generated when you first launch the web server is stored in your solution file. So, if you continue to use that solution, it should remain static from then on out. Theoretically then you could edit the solution file to specify your desired port.

    Hope this helps,
    John
  • Re: Setting Built-In Web Server Port

    06-30-2004, 9:37 PM
    • Member
      85 point Member
    • jjct1
    • Member since 04-20-2004, 11:53 AM
    • Posts 17
    Do you know if they plan to add this as a feature? I want to pin my web service on one port. So I can configure a client to access it.

  • Re: Setting Built-In Web Server Port

    06-30-2004, 11:04 PM
    • Member
      566 point Member
    • johndund
    • Member since 10-30-2002, 8:34 PM
    • Posts 112
    • AspNetTeam
    There are currently no plans for this. The personal web server is meant for serving up local pages only, so having the ability to specify a pre-set static port was not a priority. In fact, it cannot serve pages remotely. What is the purpose of your client? Is there a reason you can't use IIS for this scenario?

    Thanks,
    John
  • Re: Setting Built-In Web Server Port

    06-30-2004, 11:53 PM
    • All-Star
      29,644 point All-Star
    • Fredrik N
    • Member since 06-22-2002, 5:03 AM
    • Sweden
    • Posts 5,334
    • TrustedFriends-MVPs
    John:

    How about Omar's last post in this thred?
    /Fredrik Normén - fredrikn @ twitter

    ASPInsider

    Microsoft MVP, MCSD, MCAD, MCT

    ASPInsiders
    My Blog
  • Re: Setting Built-In Web Server Port

    07-01-2004, 3:04 AM
    • Member
      566 point Member
    • johndund
    • Member since 10-30-2002, 8:34 PM
    • Posts 112
    • AspNetTeam
    Hi Fredrik,

    I believe Omar's post is in sync with what I've said. My understanding from what he said was, in the alpha, the port number was generated new every time; it was not stored in the solution file nor was it static, and if the port number changed you would lose your reference, making P-2-P web references nearly impossible with file based web sites. (I don't have the alpha sitting around anymore, so I can't verify the behavior, but this is what I gathered). Now in the beta, when a solution is present, the port number is stored inside of it, so you can make web references to a web service in a file system web site in your solution and have it work. However, it is still originally random, and there's no way to specify the exact number you want via UI from the get-go. Does that answer your question? Am I missing something?

    Thanks,
    John
  • Re: Setting Built-In Web Server Port

    07-01-2004, 3:39 AM
    • All-Star
      29,644 point All-Star
    • Fredrik N
    • Member since 06-22-2002, 5:03 AM
    • Sweden
    • Posts 5,334
    • TrustedFriends-MVPs
    Oh, I know about this, but my purpose with adding the link to Omar's post was to show a solution that could work in beta 1. Omar's post is late but I would only like to be confirmed that it would work the way he wrote.
    /Fredrik Normén - fredrikn @ twitter

    ASPInsider

    Microsoft MVP, MCSD, MCAD, MCT

    ASPInsiders
    My Blog
  • Re: Setting Built-In Web Server Port

    07-01-2004, 12:03 PM
    • Member
      566 point Member
    • johndund
    • Member since 10-30-2002, 8:34 PM
    • Posts 112
    • AspNetTeam
    Ah, yes that now does work. jjct1--if you were talking about a "client" in a project-to-project setup (both client and web site in the same solution), then the personal web server should work just fine based on the design I've discussed above. By using the port that the personal web server originally starts on, the web references should continue to work. Apologies for the misunderstanding. Hope this helps.

    John
  • Re: Setting Built-In Web Server Port

    07-01-2004, 10:02 PM
    • Participant
      1,094 point Participant
    • omar_k
    • Member since 08-12-2002, 2:49 PM
    • Posts 213
    • AspNetTeam
    And if you absolutely want the port to be fixed, just use IIS. VWD Express, although not requiring IIS, supports IIS fully.

    Omar Khan
    Visual Web Developer Team
  • Re: Setting Built-In Web Server Port

    07-06-2004, 4:40 PM
    • Member
      85 point Member
    • jjct1
    • Member since 04-20-2004, 11:53 AM
    • Posts 17
    > What is the purpose of your client? Is there a reason you can't use IIS for this scenario?

    I am using a non-.Net client on my laptop to test. Everything is local. I am also testing a web-service security product locally. Both require links to my .Net URL. I don't have a IIS installed. How hard can it be to add a port field into the project properties?

    This is starting to be more difficult than need be. Every other Web Service tool I have used allows you to set a port. Guess I will have to switch back to Web Matrix. I have been recommending Web Matrix for people to make quick test Web Services so they can play with .Net.
  • Re: Setting Built-In Web Server Port

    07-06-2004, 5:47 PM
    • Participant
      1,570 point Participant
    • Vintious
    • Member since 03-08-2003, 10:30 PM
    • Posts 314
    I think his question is, why not install IIS?

    It wouldn't be hard to have a system to specify the port, however, the local web server is NOT designed to serve pages outside your local computer. So basically, it wouldn't work anyway.
  • Re: Setting Built-In Web Server Port

    07-06-2004, 8:15 PM
    • Participant
      1,171 point Participant
    • BradleyB
    • Member since 11-06-2002, 3:53 PM
    • Posts 227
    In the Beta there is a manual work around you can use if you really need to set the port. You can directly edit the solution .sln file referencing your disk based web. Open the .sln file in notepad then under the ProjectSection(WebsiteProperties) for your web you'll find an entry for VWDPort. Set it to whatever you need.

    Project("{E24C65DC-7377-472B-9ABA-BC803B73C61A}") = "c:\WebSites\data1\", "c:\WebSites\data1\", "{863218B9-2080-4EB4-A97F-47902CB24122}"
    ProjectSection(WebsiteProperties) = preProject
    VWDPort = 30213
    EndProjectSection
    EndProject

    WARNING: User edits to this file are not a supported scenario to be careful what you change.

    - Bradley
  • Re: Setting Built-In Web Server Port

    07-07-2004, 10:23 AM
    • Member
      85 point Member
    • jjct1
    • Member since 04-20-2004, 11:53 AM
    • Posts 17
    >I think his question is, why not install IIS?

    Where would I get IIS? I don't even know if it is installed, nor should I really care? i.e. I am putting together a platform to test simple web services and having to install yet another piece of software seems un-neccesary. I want to have other people use this setup as well.

    >It wouldn't be hard to have a system to specify the port, however, the local web server is NOT
    >designed to serve pages outside your local computer. So basically, it wouldn't work anyway.

    If you re-read my message, everything I am doing is local. I am building and testing web services and clients on my local laptop, no deployment, no remote machines. Just me and my laptop where I can work on this either connected to a network or disconnected.

    Web Matrix made it so simple, just install and play. Guess I am spoiled. I picked the .Net platform to test (being a Java developer initially) because it was so simple to build test web services with Web Matrix. Just install and create. That is all I am looking for.
  • Re: Setting Built-In Web Server Port

    07-07-2004, 10:24 AM
    • Member
      85 point Member
    • jjct1
    • Member since 04-20-2004, 11:53 AM
    • Posts 17
    Bradley,

    Thanks for the solution. I hope the Web Dev Expr. team considers adding an option to specify the port. It seems like an easy feature to add.
  • Re: Setting Built-In Web Server Port

    12-15-2009, 1:57 PM
    • Member
      43 point Member
    • vahidt_99
    • Member since 03-28-2006, 8:05 AM
    • UAE - DUBAI
    • Posts 11

    the following post will answer your question:

    http://www.taslimi.ir/post/Assign-a-static-port-to-Aspnet-Website.aspx 

Page 1 of 1 (15 items)