app.config file in a Windows control library ..Dll ?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I had an windows application with app.config file,when I build the application it converted the app.config to applicationname.exe.config file.Butwhen I convert the same application to a dll, It doesn't convert the app.config to anything? How to use the app.config file and reference it in the Dll

Line of code in the windows application that uses the app.config is as follows

RemotingConfiguration.Configure( System.Environment.CurrentDirectory + @"\" + "AppName.exe.config");
 
Hello =?Utf-8?B?UHJpeWE=?=,

App.config files are for applications, not class libraries.

In your case, you will need to convert app.config manually, or have the section defined in your calling applications app.config.
 
Thanks for your repl
If you any sample code,can you please provide me
Your second part of answer says I need to have a section defined in my calling applications app.config,can you please let me know how this can be done?Thanks agai
 
I had an windows application with app.config file,when I build the application it converted the app.config to applicationname.exe.config file.
But when I convert the same application to a dll, It doesn't convert the app.config to anything?

No, the app.config thing *ONLY* works for EXE assemblies, and the
standard ConfigurationSettings object also *ONLY* works for EXE
assemblies.
How to use the app.config file and reference it in the Dll.

You can always use a third-party config file component to handle this
situation, such as:

http://www.codeproject.com/csharp/Custom_Config_File_Reader.asp

Marc
================================================================
Marc Scheuner May The Source Be With You!
Bern, Switzerland m.scheuner(at)inova.ch
 
Back
Top