473,323 Members | 1,547 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,323 software developers and data experts.

Why dll assembly read AppSetting from its executable Config file

In my app, an executable (app.exe) calls functions from an assembly dll
(subapp.dll).

app.exe has config file: app.exe.config
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<appSettings>
<add key="configVal" value="exe config" />
</appSettings>
</configuration>

and subapp.dll.config has config file: subapp.dll.config
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<appSettings>
<add key="configVal" value="dll config" />
</appSettings>
</configuration>

When ran the app, the dll got setting from the exe's config file
instead of its own config file.

Can you tell why and how to fix it?

Thanks

Nov 16 '05 #1
2 13908
Hi keith:

The config files are assigned per application domain, so this is the
expected behavior.

Mike Woodring has a sample that uses per-assembly config files:
http://www.bearcanyon.com/dotnet/#AssemblySettings

--
Scott
http://www.OdeToCode.com/blogs/scott/

On Fri, 5 Nov 2004 10:38:02 -0800, "keith"
<ke***@discussions.microsoft.com> wrote:
In my app, an executable (app.exe) calls functions from an assembly dll
(subapp.dll).

app.exe has config file: app.exe.config
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<appSettings>
<add key="configVal" value="exe config" />
</appSettings>
</configuration>

and subapp.dll.config has config file: subapp.dll.config
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<appSettings>
<add key="configVal" value="dll config" />
</appSettings>
</configuration>

When ran the app, the dll got setting from the exe's config file
instead of its own config file.

Can you tell why and how to fix it?

Thanks


Nov 16 '05 #2
>In my app, an executable (app.exe) calls functions from an assembly dll
(subapp.dll).
app.exe has config file: app.exe.config
and subapp.dll.config has config file: subapp.dll.config
When ran the app, the dll got setting from the exe's config file
instead of its own config file.
Can you tell why and how to fix it?


Why? Because that's the way it was designed to work!

You can only "fix" it by supplying your own logic to parse and
interpret the sub-assembly's .config file - no native .NET classes or
support for that in the system, sorry.

Marc
================================================== ==============
Marc Scheuner May The Source Be With You!
Bern, Switzerland m.scheuner(at)inova.ch
Nov 16 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Rob Mayo | last post by:
I'm developing a server control for our intranet. This control is only going to be used in two applications on the server, but they must be separate. It has been established that these 2 apps...
2
by: Ellis Yu | last post by:
Dear All, I use function configurationsettings.appsetting to retrieve the connection string value which stored in a file app.config. At the beginning, it's fine that it can pick up the value...
4
by: V. Jenks | last post by:
I'm using reflection to dynamically load an assembly and even though I'm sure the assembly is present, I keep getting an error telling me the "assembly or one of its references can't be found". ...
0
by: jcvoon | last post by:
Hi: My application will compile a source code and generate an executable assembly during run time, i'm able to generate the exe, but i don't know the correct way to link a resource file into...
3
by: poppy | last post by:
I have a windows app in a virtual folder which works great on my test server. However, when I move the application to a production server I get the following error : An unhandled error has...
2
by: Shiraz | last post by:
Alright, I think I have a better perception of assemblies and environment variables now. The question I had initially posted was pertaining setting of environment variables using the VSI installer....
12
by: Steven Berkovitz | last post by:
I have several ASP.NET applications with near identical web.config files. In one of them I am successfuly able to bind to an assembly while on others I am not. All of them have the following...
4
by: =?Utf-8?B?SmFu?= | last post by:
I have a .NET 2.0 application divided in two assemblies; the exe and a dll. The application generates a plugin-dll which is then loaded in a separate AppDomain (along with a second instance of my...
8
by: Joe Withawk | last post by:
I have a solution consisting of a c# project as win application and a c++ project as classlibrary. Both are .net 2.0 The classlibrary handles some loading of quicktime movies, but that should not...
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: 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: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
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.