Click here to Skip to main content
15,921,959 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hi guys,

I have a app. it is using native c++ wrapping a C# dll and the dll is reading appsetting from app.config. if i run the native C++ program it return null when i do something like this in the c# dll:

myapp.Browser = System.Configuration.ConfigurationManager.AppSettings["Browser"];

the myapp.Browser is null.

my question is do i have to set anything in visual studio for the app.config file in order to have myapp.Browser set?

thanks
Posted
Comments
Sergey Alexandrovich Kryukov 24-Apr-14 17:35pm    
Why?!
Anyway, this is nothing but XML. Any problems parsing it?
And you don't read "app.config". You only have myApplicationFileName.exe.config.
If your C# code returns null, it is null.
—SA

1 solution

used AppDomain.CurrentDomain.SetupInformation.ConfigurationFile to find the app config file.
it returned the file path, but can't find the file
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900