Visual Studio 2015 can't start IIS Express

前端 未结 10 2128
[愿得一人]
[愿得一人] 2021-01-03 19:52

When I am trying to run an ASP.Net Core project in Visual Studio 2015, a Microsoft Visual Studio dialog appears \"The project doesn\'t know how to run the profile IIS Expres

相关标签:
10条回答
  • 2021-01-03 20:13

    This dialog showed up for me when I had migrated a project from dotnet RC1 to RC2.

    Before the fix I could still run it using dotnet run and from Visual Studio choosing the profile other than "IIS Express".

    I had misread this guide and forgot the .Web

    \DNX\Microsoft.DNX.targets –> \DotNet.Web\Microsoft.DotNet.Web.targets

    After fixing this and restarting Visual Studio(not sure if needed) I could run the project using the IIS Express profile.

    0 讨论(0)
  • 2021-01-03 20:13

    I had this same issue and after digging around for a while I discovered that I had dotnet preview v1.0.0-preview2 installed under Programs Files (x86) and a non-preview version in x64. I think VS is launching the x86 (preview) version but expecting to see the full version. To fix this, I did the following.

    • from programs and feature uninstall every visible dotnet core. (note: this did not remove the x86 preview)
    • go to https://www.microsoft.com/net/download/core#/sdk and install BOTH x86 and x64 SDK packages
    • open command line and from the root directory check run: dotnet --version (at the time of writting it was 1.0.4
    • fire up .net core project in VS 2017 and run.

    When I did all of the above, I was able to start up the site in IIS Express from VS.

    0 讨论(0)
  • 2021-01-03 20:19

    In my case the issue was solved after added the ASP.NET and web development tool extension to my VS instalation.

    0 讨论(0)
  • 2021-01-03 20:20

    You can get this error with RTM if <BaseIntermediateOutputPath gets corrupted or is incorrect in your .xproj file.

    0 讨论(0)
  • 2021-01-03 20:22

    Same thing happened to me, my project was working fine. I didn't do any RC1 to RC2 update & this popup appeared from nowhere.

    I fixed the problem by updating visual studio. You can also consider repairing VS.

    0 讨论(0)
  • 2021-01-03 20:24

    To clarify the answer from hultqvist, it is a problem with the xproj. To fix it, edit the xproj directly and change this

    <Import Project="$(VSToolsPath)\DotNet\Microsoft.DotNet.targets" 
            Condition="'$(VSToolsPath)' != ''" />
    

    to this

    <Import Project="$(VSToolsPath)\DotNet.Web\Microsoft.DotNet.Web.targets" 
            Condition="'$(VSToolsPath)' != ''" />
    

    That is, insert Web twice.

    There is an associated issue in the aspnet tooling repo.

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