473,698 Members | 2,246 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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" ?>
<configuratio n>
<appSettings>
<add key="configVal" value="exe config" />
</appSettings>
</configuration>

and subapp.dll.conf ig has config file: subapp.dll.conf ig
<?xml version="1.0" encoding="utf-8" ?>
<configuratio n>
<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 13928
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***@discussi ons.microsoft.c om> 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.conf ig has config file: subapp.dll.conf ig
<?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.conf ig has config file: subapp.dll.conf ig
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)i nova.ch
Nov 16 '05 #3

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

Similar topics

6
2458
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 will use a specifically named key from their respective web.config's. I want the control to use that key regardless of which application it's being used on. How can I get that key from the application? I considered creating a config file for the...
2
2730
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 according to the key passed into function. But when I make some change in the value of app.config, it still pick up the old value to me, not the updated one. I'd tried to rebuild the project or quit the vb.net and re-start it again. It still pick up...
4
2593
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". I do in fact have a reference to the assembly in question in the project and I even tried declaring it with "using" at the top of the class file. Here's the method that fails:
0
1598
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 exe. here is my code to generate the exe during run time: Public Sub GenerateStub() Dim sSourceCode As String = Path.Combine(Path.GetTempPath,
3
2236
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 occured in your application. Object not set to an instance of an object. This only occurs when I try to read my connection string from my app.config file : lconnstr='System.Configuration.ConfigurationSettings.AppSettings("MyConnString").ToString
2
2960
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. This was presumed essential for specifying the paths to certain dlls. Subsequently, the idea was dropped, and the appication configuration file approach was adopted. However, the application is not able to resolve the assembly location, and...
12
3268
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 qualifiers: <runtime> <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"> <qualifyAssembly partialName="OrderDynamics.ImageService.Interfaces"...
4
4470
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 application dll). It's been working for months and now the it's not working from my application exe anymore but still working from NUnit when testing the dll. What could have changed in my exe? Some configuration thing in my VS2005 project?
8
3739
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 be relevant. On my development machine I build the exe and dll and run the exe which has a reference to the dll. At some point it uses featured in the dll. This works fine. Then I copy my exe and dll to the target system and when the featured...
0
8683
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9170
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9031
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8901
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
6528
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5862
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4371
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
2336
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2007
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.