How can I change IIS Express port for a site

后端 未结 12 1435
死守一世寂寞
死守一世寂寞 2020-11-29 02:32

I want to change the port number on which my website runs while debugging from Visual Studio. I am using Visual Studio 2012, and I am using ASP.NET MVC 4 for my projects I w

12条回答
  •  萌比男神i
    2020-11-29 03:20

    .Net Core

    For those who got here looking for this configuration in .Net core this resides in the lauchSettings.json. Just edit the port in the property "applicationUrl".

    The file should look something like this:

    {
      "iisSettings": {
        "windowsAuthentication": false,
        "anonymousAuthentication": true,
        "iisExpress": {
          "applicationUrl": "http://localhost:53950/", //Here
          "sslPort": 0
        }
      },
      "profiles": {
        "IIS Express": {
          "commandName": "IISExpress",
          "launchBrowser": true,
          "launchUrl": "index.html",
          "environmentVariables": {
            "Hosting:Environment": "Development"
          },
        }
      }
    }
    

    Or you can use the GUI by double clicking in the "Properties" of your project.

    Note: I had to reopen VS to make it work.

提交回复
热议问题