ASP.NET 5 MVC: unable to connect to web server 'IIS Express'

后端 未结 30 1824
北恋
北恋 2020-12-12 13:28

What I\'m doing:

  • Opening Visual Studio Community 2015
  • File -> New -> Project
  • Under Visual C#: Web -> ASP.NET Web Application
  • Web App
相关标签:
30条回答
  • 2020-12-12 13:37

    I faced this issue in .net core 2.0 when I update my project's port number.

    I was able to sort out issue in two steps :

    • STEP 1 : DELETE .vs folder which is hidden inside main solution folder. (close visual studio before this) then when you start again visual studio, this folder and file (applicationhost.config) inside it will automatically create by visual studio.
    • STEP 2 : For multiple startup projects, if you are still facing issue then one by one run project as startup, and then run as multiple startup project.
    0 讨论(0)
  • 2020-12-12 13:37

    I just changed my profile from "IIS Express" to "MyProjectName" (which I think is using kestrel as the http server instead of IIS) and now it's working fine:

    0 讨论(0)
  • 2020-12-12 13:38

    I just encountered the same problem and I killed all the "iisexpress.exe" processes that were still running. That worked for me!

    0 讨论(0)
  • 2020-12-12 13:39

    For me the problem was that an other process was using the same port. (In my case it was outlook that was using the same port as my site and thus my site couldn't start)

    Yes you can change the local port, but if you are running an API or something that other applications need, you don't always want to do this.

    To get a list of what applications are using what port open CMD and type "netstat -aon" You will get a list of ports. Find the port that your site should use, or that you want to use and write down / remember the PID.

    Now open task manager and click on the tab 'details'. Find the process with your PID and end it. Now you should be able to start IIS Express with that port.

    0 讨论(0)
  • 2020-12-12 13:40

    I had this issue on .net core 2.1, visual studio version 15.9.6. When i deleted the .vs folder, i reopened visual studio and the problem was still there. The solution that worked for me below:

    1. Delete .vs folder (it is a hidden folder).
    2. Restart Computer.

    Other Solutions:

    • Close Visual Studio, delete bin and obj folders from the project folder. Open Project then rebuild solution.
    • Try running Visual Studio as Administrator.
    • Clean Solution then rebuild
    • 1) Clean Solution. 2) Exit Visual Studio. 3) delete .vs folder 4) Re-open Visual Studio
    0 讨论(0)
  • 2020-12-12 13:40

    For me, it was a mixture of following these instructions:

    Delete your web application’s .vs\applicationhost.config and try again.

    And then, perhaps most importantly, running Visual Studio with admin privileges.

    0 讨论(0)
提交回复
热议问题