Visual Studio 2015 can't start IIS Express

19,725

Solution 1

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.

Should also be noted that as per the comments, adding .Web in the top level node is required in the xproj. <Project Sdk="Microsoft.NET.Sdk"> should be <Project Sdk="Microsoft.NET.Sdk.Web">.

Solution 2

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

enter image description here

Solution 3

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.

Solution 4

I had the same issue and found a very simple solution for Visual Studio 2017. In Visual Studio 2017 go to Solution Explorer then right click on your project file. In the menu you will see "Set as StartUp Project". If you can select it then select it. Now run your project again.

Solution 5

I had a similar issue, In my case ASP.NET and web development is enabled but Development time IIS support is not checked in the optional sections.

Once I enable the Development time IIS support solved my issue.

enter image description here

Share:
19,725
ovasylenko
Author by

ovasylenko

Data scraping

Updated on June 14, 2022

Comments

  • ovasylenko
    ovasylenko almost 2 years

    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 Express".

    Does anyone know anything about this message, or how to fix it? I've searched Google and the MSDN. There's nothing in the build logs, or the Windows event log.

    Microsoft Visual Studio: The project doesn't know how to run the profile IIS Express.