What else is required to debug/launch dotnet core web API in IIS/browser instead of 'Project' or 'Executable'?

Jay M 1 Reputation point
2022-01-19T15:02:06.537+00:00

I cannot get VS2017 to run debug for dotnet core in web browser. It requires 'executable' or 'project'. This app used to work but this is a new dev machine and I'm missing something in configuration. To troubleshoot, I'm following:

https://learn.microsoft.com/en-us/visualstudio/debugger/how-to-enable-debugging-for-aspnet-applications?view=vs-2017

The above documentation mentions the following setup:

166444-image.png

However, even after installing dotnet core development packages, my options remain:

166409-image.png

I have installed:

ASP.NET Core 6.0 Runtime (v6.0.1) - Windows Hosting Bundle  
Appropriate dotnet core dev package (2.1)  
VS Installer: "ASP.NET and web development" workload w/ "Development time IIS support"  
VS Installer: IIS individual component  

Here is my launchSettings.json profile:

   "IIS Express": {  
     "commandName": "IIS",  
     "launchBrowser": true,  
     "launchUrl": "api/values",  
     "environmentVariables": {  
       "ASPNETCORE_ENVIRONMENT": "Development"  
     }  
   }  

Which gives:

166481-image.png

...likely because I'm forcing IIS as a Launch Option but it's not actually available. If I set it to Project or Executable (and change from class library to console), it will run in console. But this isn't how I did it before and this way gives me 404 to all method calls.

ASP.NET Core
ASP.NET Core
A set of technologies in the .NET Framework for building web applications and XML web services.
4,671 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Bruce (SqlWork.com) 68,081 Reputation points
    2022-01-19T16:17:10.563+00:00

    vs 2017 stopped supporting asp.net core at 2.1.526 and you have installed later bits. You best bet is to upgrade to vs 2022 as .net 2.1 is out of support.

    if you must get it working, uninstall the new bits and install old bits:

    you will want to install the old hosting bundle and runtimes.

    https://dotnet.microsoft.com/en-us/download/dotnet/2.1

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.