3

I have a large solution stored in a repository on GitHub. It is working fine. But when I download that repository to another computer, it does not run in debug mode.

The solution runs two projects: My main project and an API project. On my original computer, my API project loads at port 44360. But on the new computer at port 7184.

Here is my launchsettings.json file for my API application. It is the same on both computers.

{
  "$schema": "https://json.schemastore.org/launchsettings.json",
  "iisSettings": {
    "windowsAuthentication": false,
    "anonymousAuthentication": true,
    "iisExpress": {
      "applicationUrl": "http://localhost:40682",
      "sslPort": 44360
    }
  },
  "profiles": {
    "TTRailtrax": {
      "commandName": "Project",
      "launchBrowser": true,
      "launchUrl": "swagger",
      "environmentVariables": {
        "ASPNETCORE_ENVIRONMENT": "Development"
      },
      "applicationUrl": "https://localhost:7184;http://localhost:5184",
      "dotnetRunMessages": true
    },
    "IIS Express": {
      "commandName": "IISExpress",
      "launchBrowser": true,
      "launchUrl": "swagger",
      "environmentVariables": {
        "ASPNETCORE_ENVIRONMENT": "Development"
      }
    }
  }
}

I don't quite understand why the code seems to interpret the launch settings differently depending on which computer it is running on. Apparently, it is related to a setting that is not stored in the repository, and so must be set manually.

Update

Below is a screenshot of my start up item. Note that my solution is configured to run two projects and options above the divider are my multi-project start up configurations.

enter image description here

2
  • 1
    The Visual Studio in your other computer may select the "TTRailtrax" profile instead of "IIS Express" profile as the default debug option e.g. user-images.githubusercontent.com/20598632/… Commented Oct 13 at 21:40
  • @BenLam: Yes, that was it. My startup item did not look like yours because my solution was configured to run multiple projects. But by selecting individual projects, I was able to get this working. Thanks. Commented Oct 13 at 21:52

1 Answer 1

1

In order to use the IIS SSL settings, you need to set your project to use IIS Express.

enter image description here

My problem was that, when the solution is configured to run multiple projects, this option is not available.

enter image description here

In this case, it is necessary to select each project as the only startup project, set it to use IIS Express, and then set it back to run multiple projects.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.