locked
how to Provide Path in appsettings.json in linux RRS feed

  • Question

  • User-1322819052 posted

    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 

    Monday, March 29, 2021 4:02 AM

All replies

  • User-474980206 posted

    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

    Monday, March 29, 2021 2:35 PM