question

easy999000-8916 avatar image
0 Votes"
easy999000-8916 asked easy999000-8916 commented

ubuntu下面运行asp.net core 不加载appsettings.json配置文件

我做了一个asp.net core5.0的站点,发布在ubuntu服务器上,
发现如果我不在程序所在文件夹下面运行站点,站点遍不会加载 appsettings.json配置文件

只要不在程序所在文件夹去启动站点,其他任何文件夹都不会加载 appsettings.json配置文件,这是为什么呢??

143188-file.png


143140-image.png



dotnet-aspnet-core-generaldotnet-runtimedotnet-aspnet-core-mvc
file.png (63.1 KiB)
image.png (207.1 KiB)
· 2
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hi @easy999000-8916,

Currently in Microsoft Q&A we only support English, could you please edit your question into English? Then we can help to solve your issues, thanks for your understanding.

0 Votes 0 ·

Run asp.net core under Ubuntu without loading the appsettings.json configuration file
I made an asp.net core 5.0 site and published it on the Ubuntu server,
It is found that if I do not run the site under the folder where the program is located, the appsettings.json configuration file will not be loaded
As long as the site is not started in the folder where the program is located, the appsettings.json configuration file will not be loaded in any other folder. Why??

0 Votes 0 ·

0 Answers