I am a noob in the development world , but I am stuck in a problem. I have upgraded my dot net core 2.2 mvc project to 3.1 and published it in windows and linux platform.
The thing is when i run the project on Windows OS , its working fine. but when I try to run the published code on Linux systems, I get an error saying it cannot find the path to the configuration file set in my appsettings.json
THIS IS THE NODE APPLIED ON APPSETTINGS.JSON FOR WINDOWS
"ConfigFiles": "D:\\B2B_TFS\\ConfigFiles_new\\",
and it is working fine
But Getting this error on Linux
System.IO.FileNotFoundException: Could not find file '/var/www/ConfigFiles_new/core.config.xml'. ( set in appsettings.json)
I have verified that Config is present and given full rights to the directories.
Question : what is the correct way to provide directory path in appsettings.json
None
0 Points
1 Post
how to Provide Path in appsettings.json in linux
Mar 29, 2021 04:02 AM|adityadubey057|LINK
Hi Team,
I am a noob in the development world , but I am stuck in a problem. I have upgraded my dot net core 2.2 mvc project to 3.1 and published it in windows and linux platform.
The thing is when i run the project on Windows OS , its working fine. but when I try to run the published code on Linux systems, I get an error saying it cannot find the path to the configuration file set in my appsettings.json
THIS IS THE NODE APPLIED ON APPSETTINGS.JSON FOR WINDOWS
"ConfigFiles": "D:\\B2B_TFS\\ConfigFiles_new\\",
and it is working fine
But Getting this error on Linux
System.IO.FileNotFoundException: Could not find file '/var/www/ConfigFiles_new/core.config.xml'. ( set in appsettings.json)
I have verified that Config is present and given full rights to the directories.
Question : what is the correct way to provide directory path in appsettings.json
All-Star
58464 Points
15787 Posts
Re: how to Provide Path in appsettings.json in linux
Mar 29, 2021 02:35 PM|bruce (sqlwork.com)|LINK
Filenames on Linux are case sensitive. Be sure you have it correct spelling. At shell command check
ls var/www/ConfigFiles_new/core.config.xml