更改 Blazor 应用程序端口的最简单方法,以便两个版本可以并行运行

问题描述 投票:0回答:1

我有两个版本的 Blazor 项目,较新的版本存在一些问题。我想在同一台电脑上同时跟踪它们,但无法做到,因为它们都使用相同的根路径和端口。

更改其中一个项目的端口以便它们可以同时运行的最简单方法是什么?

非常感谢

.net blazor
1个回答
0
投票

每个站点的端口在 Properties 文件夹中的 launchSettings.json 中设置。

{
  "$schema": "http://json.schemastore.org/launchsettings.json",
    "iisSettings": {
      "windowsAuthentication": false,
      "anonymousAuthentication": true,
      "iisExpress": {
        "applicationUrl": "http://localhost:64180",
        "sslPort": 44398
      }
    },
    "profiles": {
      "http": {
        "commandName": "Project",
        "dotnetRunMessages": true,
        "launchBrowser": true,
        "applicationUrl": "http://localhost:5145",
        "environmentVariables": {
          "ASPNETCORE_ENVIRONMENT": "Development"
        }
      },
      "https": {
        "commandName": "Project",
        "dotnetRunMessages": true,
        "launchBrowser": true,
        "applicationUrl": "https://localhost:7016;http://localhost:5145",
        "environmentVariables": {
          "ASPNETCORE_ENVIRONMENT": "Development"
        }
      },
      "IIS Express": {
        "commandName": "IISExpress",
        "launchBrowser": true,
        "environmentVariables": {
          "ASPNETCORE_ENVIRONMENT": "Development"
        }
      }
    }
  }
© www.soinside.com 2019 - 2024. All rights reserved.