.NET config file

S

Suresh Gladstone

Can we have a config file writter for a DLL type
assembly? I Have tried writing this kind , but doesnt
work. It works fine when a config file is written for an
Exe
 
H

Hermit Dave

config files are for applications exe's or dll's doesnt matter
if you have used asp.net you will know that the codebehind files are
compiled and dll is container.

for non application assemblies ie your controls etc. you have to rely on the
configuration files of the containing project.
say you have winforms controls you can use app.config the way you normally
do.. i dont see why you cant write to it either. The only thing you need to
remember is that the assembly wont have its unique config file instead it
will use the config file of the application in which it is included.

i hope i could make it clear.

--

Regards,

Hermit Dave
(http://hdave.blogspot.com)
 
M

Marc Scheuner [MVP ADSI]

config files are for applications exe's or dll's doesnt matter

No, that's not entirely correct- for Winforms applications, config
files are for EXE exclusively - *ONLY* EXE apps have associated
myapp.exe.config files.

ASP.NET web apps have a app-wide "web.config" configuration file
that's accessible from any DLL of that web app. But a Winforms app
doesn't support separate mylibrary.dll.config files for DLL's - you'll
have to roll your own.

Marc

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

Suresh Gladstone

Hi Guys,
Thanks for the info. It helped a lot. Special thanks to
Jose for giving a vivid idea.

Regards,
_Glad
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top