473,325 Members | 2,671 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,325 software developers and data experts.

Config Files

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
4 1200
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
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
> 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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Fuzzyman | last post by:
There have been a couple of config file 'systems' announced recently, that focus on building more powerful and complex configuration files. ConfigObj is a module to enable you to much more *simply*...
22
by: Daniel Billingsley | last post by:
Ok, I wanted to ask this separate from nospam's ridiculous thread in hopes it could get some honest attention. VB6 had a some simple and fast mechanisms for retrieving values from basic text...
1
by: Rolf Molini | last post by:
Hello everybody, I put this in a separate thread because altough it is connected to the localization-problem in my former thread this is a completely different "joke" of the IDE. While waiting...
4
by: Bennett Haselton | last post by:
If I add this to my web.config file: <authentication mode="Forms"> <forms name=".ASPXUSERDEMO" loginUrl="login.aspx" protection="All" timeout="60" /> </authentication> I can configure the...
4
by: Jeffrey Palermo [MCP] | last post by:
I use web.config files in many directories, and my aspx files can access the AppSettings. If I have a subdirectory Foo with an aspx, and Foo has a local web.config that defines an AppSetting. My...
8
by: Graham | last post by:
I noticed a similar post awhile ago and in terms of my problem it wasnt a suitable answer so I will ask again. I have VS2005 running a on development machine in my office where I do all my...
1
by: Joseph Geretz | last post by:
I need to download a greater than 4 megabyte attachment via WSE / DIME. The only way I know how to configure this is via a .config file. Normally, the ..config file is the same name as the base...
20
by: tomerfiliba | last post by:
hey i've been seeing lots of config-file-readers for python. be it ConfigObj (http://www.voidspace.org.uk/python/configobj.html) or the like. seems like a trend to me. i came to this conclusion...
11
by: TARUN | last post by:
Hello All I need to ask about the configuration file in .NET, There are Two config File 1. Web Config 2. Machine config I understand the the usage of Web config , but not able to understand...
1
by: herbert | last post by:
In VS.2005 a Windows Service can have an app.config file. A class library can also have an app.config file. Now if my Windows Services uses three class libraries, each of it coming with its own...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.