简体   繁体   English

为什么 Azure 应用服务不使用 launchSettings.json 配置?

[英]Why Azure App Service doesn;t use launchSettings.json config?

I need some help.我需要帮助。

I deployed Asp Net Core app on Azure App Service(Windows).我在 Azure 应用服务(Windows)上部署了 Asp Net Core 应用。 It's not use my standart configurations in launchSettings.json它不使用我在 launchSettings.json 中的标准配置在此处输入图片说明

But uses random port per starting.但每次启动使用随机端口。 For example :例如 :

[INF] Now listening on: "http://127.0.0.1:4340" [INF] 正在收听:“http://127.0.0.1:4340”

[INF] Now listening on: "http://127.0.0.1:8105" [INF] 正在收听:“http://127.0.0.1:8105”

[INF] Now listening on: "http://127.0.0.1:13605" [INF] 正在收听:“http://127.0.0.1:13605”

When I running it in my own computer all routes and ports work correct.当我在自己的计算机上运行它时,所有路由和端口都正常工作。 Why this situation appear with Azure App Service deploy ?为什么在 Azure App Service 部署时会出现这种情况?

Because launchSettings.json is exclusively for Visual Studio.因为launchSettings.json专用于 Visual Studio。

From the documentation :文档

The environment for local machine development can be set in the Properties\\launchSettings.json file of the project.本地机器开发的环境可以在项目的Properties\\launchSettings.json文件中设置。 Environment values set in launchSettings.json override values set in the system environment. launchSettings.json 中设置的环境值会覆盖系统环境中设置的值。

The launchSettings.json file: launchSettings.json 文件:

  • Is only used on the local development machine.仅在本地开发机器上使用。
  • Is not deployed.未部署。
  • contains profile settings.包含配置文件设置。

Moreover, even if you switched from Visual Studio to Visual Studio Code, you would have to use the file .vscode/launch.json .此外,即使您从 Visual Studio 切换到 Visual Studio Code,也必须使用文件.vscode/launch.json

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 launchSettings.json launchUrl 不起作用“api/values” - launchSettings.json launchUrl doesn't work "api/values" 为什么存在 aspNetCore web.config 部分时,launchSettings.json 配置文件中的 environmentVariables 不加载? - Why do environmentVariables from launchSettings.json profiles not load when aspNetCore web.config sections exist? 更改launchSettings.json中的端口会显示“无法访问此站点” - Changing port in launchSettings.json gives “This site can’t be reached” ASP.NET Core 2.2 如何在项目之间共享 web.config/launchSettings.json 文件 - ASP.NET Core 2.2 How to share web.config/launchSettings.json files among projects Visual Studio for Mac 忽略launchSettings.json - Visual Studio for Mac Ignoring launchSettings.json 微服务未在 LaunchSettings.JSON 设置的端口上启动 - Microservice not Launching on Port Set by LaunchSettings.JSON Launchsettings.json 不是使用 dotnet new 创建的 - Launchsettings.json not created using dotnet new launchSettings.json 文件打开错误的 URL - launchSettings.json file opens wrong URL launchSettings.json 和 appSettings.json 是如何工作的? - how do launchSettings.json and appSettings.json work? 如何在 linux 上的 launchsettings.json 中引用环境变量 - How to reference environment variables in launchsettings.json on linux
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM