Getting rootPath in DependencyRegistrar error

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
5 years ago
Nop team

following this changeset Extracted File IO Functions
https://github.com/nopSolutions/nopCommerce/commit/69ecaba79fd592c3b35dce0c344ed1481b59c56b

I use a second database and i send the path to dataSettingsManager
before the changeset we use CommonHelper, now I dont have access to INopFileProvider


     var DataSettingsFilePath = "~/App_Data/secondDataBase.json";
     DataSettingsFilePath = DataSettingsFilePath.Replace("~/", "").TrimStart('/').Replace('/', '\\');
            //data layer
            var dataSettingsManager = new DataSettingsManager();
            var dataProviderSettings = dataSettingsManager.LoadSettings(DataSettingsFilePath, true);


please advice

P.S. it works like that from App_data but not from other folders
5 years ago
anyone?
5 years ago
var DataSettingsFilePath = Path.Combine("~/App_Data/secondDataBase.json");

try this.
5 years ago
khalil_sandilkar wrote:
var DataSettingsFilePath = Path.Combine("~/App_Data/secondDataBase.json");

try this.


Path.Combine will combine strings together, u need to have the root path in order to combine it and that is what im looking for
5 years ago
Nop team can u please address this issue
how can i get the root path in dependency register ?
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.