[英]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.