Dear All
How to get value from appSetings (“program.servername”) in web.config using net core 8.
<configuration>
<appSettings>
<add key=”Wisej.LicenseKey” value=””/>
<add key=”Wisej.DefaultTheme” value=”Bootstrap-4″/>
<add key=”program.servername” value=”localhost”/>
</appSettings>
</configuration>
in Framework 4.x,its return value=”localhost” using code
string value = System.Configuration.ConfigurationManager.AppSettings[“program.servername”];
but if using net core 8, return value=”null” using the same code. (program didn’t find the configuration key, i had try to copy file web.config to folder \bin\Debug\net8.0, the result is same).
Thanks
Finally i got the answer.
<appSettings><add key=”program.servername” value=”localhost”/></appSettings></configuration>
base on this link
This isn’t a Wisej specific issue- .NET Core doesn’t support web.config.
Wisej.NET reads its own settings using the ConfigurationManager class.
Configuration Manager documentation: https://learn.microsoft.com/en-us/dotnet/api/system.configuration.configurationmanager?view=net-8.0
Please login first to submit.