0

Consider the following:

  • console application in netcoreapp2.1 that is set up to load some NuGet packages and place them in a folder within the project. Upon completion, application stops
  • After upgrading the application to net6.0, the NuGet pckages are only loaded after making an HTTP request to any endpoint in the app

More specifically, I hit F5 to launch the application in Debug mode:

  • netcoreapp2.1 does what it is supposed to, and then debug stops
  • net6.0 does not start application until HTTP request is sent from browser
  • the process name is different between the applications

enter image description here

Trying to find what could be causing this, I came across this post that lists an expected flow of actions when we hit F5:

  1. VS will load all required symbols
  2. Then, it will attach the debugger to a process
  3. Then, it will launch the application

It seems like my net6.0 does not hit step 1 until I make a call to an endpoint, but I am not sure how to move forward, or what to look for.

I'm very new to development in general, and often can't find the proper terms to use when searching for a problem, so any advice you can give search-wise is appreciated!

1 Answers1

1

After seeing this answer in another post, I realized I was debugging using the wrong profile. After selecting the project one (or using process {project name}.exe), the application behaved as expected.

launchSettings.json -> profiles

Before:

"profiles": {
    "IIS Express": {
      "commandName": "IISExpress",
      "launchBrowser": true,
      "launchUrl": "",
      "environmentVariables": {
        "ASPNETCORE_ENVIRONMENT": "Development"
      }
    }

After:

"profiles": {
    "Project Name": {
      "commandName": "Project",
      "launchBrowser": true,
      "environmentVariables": {
        "ASPNETCORE_ENVIRONMENT": "Development"
      },
      "applicationUrl": "https://localhost:5001;http://localhost:5000",
      "hotReloadEnabled": false
    }
  }