forever_learner
forever_learner

Reputation: 86

F5 does not launch application until an endpoint is called

Consider the following:

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

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!

Upvotes: 0

Views: 91

Answers (1)

forever_learner
forever_learner

Reputation: 86

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
    }
  }

Upvotes: 1

Related Questions