Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Two projects with same launchsettings.json load with different port numbers

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

like image 373
Jonathan Wood Avatar asked Aug 02 '26 15:08

Jonathan Wood


1 Answers

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.

like image 65
Jonathan Wood Avatar answered Aug 05 '26 14:08

Jonathan Wood