By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,827 Members | 2,220 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,827 IT Pros & Developers. It's quick & easy.

Config Files

P: n/a
Hi all

I am using App.Config files to store custom settings in the appSettings
section for my executable. This works fine, but I have another Assembly
which is a dll and I can't seem to get the dll to read from the config file.
Is it possible to do this?

I have placed the config file 'MyAssembly.dll.config' in the same folder as
the assembly itself, but when I step through the code it doesn't pick up the
values like my exe config file.

Any help is greatly appreciated,

Kind Regards,
Steve.
Jul 21 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a
I may be mistaken on this but I believe the config file applies to the EXE
only. Your DLL would look at the "appname.exe.config" file for its
information.

--
Thanks, Jeff
"Steve" <stevea@centurion-ms_RemoveThis_.co.uk> wrote in message
news:Op**************@tk2msftngp13.phx.gbl...
Hi all

I am using App.Config files to store custom settings in the appSettings
section for my executable. This works fine, but I have another Assembly
which is a dll and I can't seem to get the dll to read from the config file. Is it possible to do this?

I have placed the config file 'MyAssembly.dll.config' in the same folder as the assembly itself, but when I step through the code it doesn't pick up the values like my exe config file.

Any help is greatly appreciated,

Kind Regards,
Steve.

Jul 21 '05 #2

P: n/a
Hi Jeff

Thanks for your reply. Guess I'll have to read a custom file as my DLL is a
..NET Remoting object on another machine and can't read the EXE config file.

Do you know if the DLL will always look at the exe config file if they are
on the same computer? So if the dll is in the GAC or elsewhere it will be
'aware' of the appSettings section in the appname.exe.config?

Cheers,
Steve.

"Jeff B." <je**@nowhere.com> wrote in message
news:#1**************@tk2msftngp13.phx.gbl...
I may be mistaken on this but I believe the config file applies to the EXE
only. Your DLL would look at the "appname.exe.config" file for its
information.

--
Thanks, Jeff
"Steve" <stevea@centurion-ms_RemoveThis_.co.uk> wrote in message
news:Op**************@tk2msftngp13.phx.gbl...
Hi all

I am using App.Config files to store custom settings in the appSettings
section for my executable. This works fine, but I have another Assembly
which is a dll and I can't seem to get the dll to read from the config

file.
Is it possible to do this?

I have placed the config file 'MyAssembly.dll.config' in the same folder

as
the assembly itself, but when I step through the code it doesn't pick up

the
values like my exe config file.

Any help is greatly appreciated,

Kind Regards,
Steve.


Jul 21 '05 #3

P: n/a
> Do you know if the DLL will always look at the exe config file if they are
on the same computer? So if the dll is in the GAC or elsewhere it will be
'aware' of the appSettings section in the appname.exe.config?


That is my understanding. If someone else knows different, then please feel
free to correct me :-)

--
Thanks, Jeff
Jul 21 '05 #4

P: n/a
Hi Steve,

Config files are at an .exe level, not at an Assembly level, so you will not
be able to do what you want to do here.

You probably should think about creating a configuration section for
your assembly in your main exe's app.config file.

Regards,

Bennie Haelen

"Steve" <stevea@centurion-ms_RemoveThis_.co.uk> wrote in message
news:Op**************@tk2msftngp13.phx.gbl...
Hi all

I am using App.Config files to store custom settings in the appSettings
section for my executable. This works fine, but I have another Assembly
which is a dll and I can't seem to get the dll to read from the config file. Is it possible to do this?

I have placed the config file 'MyAssembly.dll.config' in the same folder as the assembly itself, but when I step through the code it doesn't pick up the values like my exe config file.

Any help is greatly appreciated,

Kind Regards,
Steve.

Jul 21 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.