NoviceMer
Member
- Joined
- Jan 27, 2021
- Messages
- 9
- Programming Experience
- 5-10
Dear Developers,
I would like to clarify my understanding that there is bug with application configuration file provided by Nuget package for System.Configuration.ConfigurationManager. Attempting to follow Microsoft advice but ConfigurationManager.AppSettings["key0"] cannot receive the input.
Below is the code:
	
	
	
	
	
	
	
	
	
		
			
			
			
			
			
		
	
	
	
		
	
	
		
	
At program.cs:
	
	
	
	
	
	
	
	
	
		
			
			
			
			
			
		
	
	
	
		
	
	
		
	
Your kind sharing is very much appreciated.
Best Regards
	
		
			
		
		
	
				
			I would like to clarify my understanding that there is bug with application configuration file provided by Nuget package for System.Configuration.ConfigurationManager. Attempting to follow Microsoft advice but ConfigurationManager.AppSettings["key0"] cannot receive the input.
Below is the code:
			
				XML:
			
		
		
		<?xml version="1.0" encoding="utf-8" ?>
<configuration>
    <startup>
        <supportedRuntime version ="v4.0" sku=".NETFramework,Version=v4.5" />
    </startup>
    <appSettings>
        <add key ="key0" value="test"/>
    </appSettings>
</configuration>
			
				C#:
			
		
		
		using System.Configuration;
using System.Collections.Specialized;
static void Main(string[] args)
{
     string sSrvName = ConfigurationManager.AppSettings["Key0"];
}Your kind sharing is very much appreciated.
Best Regards
			
				Last edited by a moderator: 
			
		
	
								
								
									
	
		
			
		
		
	
	
	
		
			
		
		
	
								
							
							 
	 
 
		