Hello,
I started a project using WiseJ -latest version. I noticed it was using .net 48 . I am trying to target .net Core to run on linux, so i changed it to target just .net 9.
Now my webconfig is not longer being read using:
string ls_path = System.Configuration.ConfigurationManager.AppSettings[“Files.DataPath”];
The .net core docs say that the file it tries to read is app.config ?
What am i doing wrong ?
So -question – if running under .Net Core – WiseJ does not need any of the settings from the Webconfig at all ?
Ahh I see. I was going by the WiseJ docs. Figured you guys were reading from Web config behind the scenes no matter what.
Net core doesn’t support web.config – web.config won’t be read if you target only net core.
You can either use app.config or set up environment variables in launchSettings.json
If you’re just trying to do something like reading a connection string from the web.config file, you can just copy and paste the things you want in app.config.
Finally you can use https://learn.microsoft.com/en-us/dotnet/api/system.configuration.configurationmanager.openmappedexeconfiguration and read web.config.
Please login first to submit.