473,657 Members | 2,531 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Problem with app.config from dll

I have a solution with 2 projects: a class library(my.dll) + a windows
application (mine.exe). In exe project I have a reference to the dll. In
both I have app.config files, BUT only mine.exe.config file is generated in
\bin\Debug\ folder of exe app. What can I do to generate my.dll.config from
app.config, too?

Thnx for any advice.

Nov 15 '05 #1
3 55112
Bragadiru,

DLL (class libraries) do not have config files. Rather, they share the
configuration information of the EXE that is being used.

What you will have to do is create your own configuration file and read
it appropriately.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- ni************* *@exisconsultin g.com

"Bragadiru" <ad****@cims.ro > wrote in message
news:OZ******** ******@tk2msftn gp13.phx.gbl...
I have a solution with 2 projects: a class library(my.dll) + a windows
application (mine.exe). In exe project I have a reference to the dll. In
both I have app.config files, BUT only mine.exe.config file is generated in \bin\Debug\ folder of exe app. What can I do to generate my.dll.config from app.config, too?

Thnx for any advice.

Nov 15 '05 #2
Bragadiru,
The .Net framework, by default does not use a my.dll.config. Any dll in your
solution will use the mine.exe.config file.

You can 'force' your DLL to use the my.dll.config, by creating a new
AppDomain, setting the AppDomainSetup. ConfigurationFi le to 'my.dll.config' ,
then run the dll in the second AppDomain. Then ensure that the dll runs in
this second AppDomain, while your exe runs in the first AppDomain... There
have been posts in one of the microsoft public dotnet newsgroups on how to
get it to work, I do not have links handy.

Currently I manually add the settings the DLL needs to my 'mine.exe.confi g'
file and let the dll use those. I use custom configuration sections to
ensure that DLL settings are isolated from exe settings.

These dll configuration sections are defined via:
http://msdn.microsoft.com/library/de...onhandlers.asp

and:
http://msdn.microsoft.com/library/de...ionsschema.asp

Eventually I intend on creating a custom
System.Configur ation.Install.I nstaller class that will add the needed
entries to the app.config that the dll needs.

Hope this helps
Jay

"Bragadiru" <ad****@cims.ro > wrote in message
news:OZ******** ******@tk2msftn gp13.phx.gbl...
I have a solution with 2 projects: a class library(my.dll) + a windows
application (mine.exe). In exe project I have a reference to the dll. In
both I have app.config files, BUT only mine.exe.config file is generated in \bin\Debug\ folder of exe app. What can I do to generate my.dll.config from app.config, too?

Thnx for any advice.

Nov 15 '05 #3
See MSDN -> Visual Basic and Visual C# Concepts

Walkthrough: Storing and Retrieving Dynamic Properties

"The configuration file in the project folder is named App.config. When you
build the project, it is copied to the output folder and renamed to
Assemblyname.co nfig, where assemblyname is the project output, for example,
MyLibrary.dll or MyApplication.e xe. You need to modify this copy of the
..config file to affect a deployed application."
!!??????

"Bragadiru" <ad****@cims.ro > wrote in message
news:OZ******** ******@tk2msftn gp13.phx.gbl...
I have a solution with 2 projects: a class library(my.dll) + a windows
application (mine.exe). In exe project I have a reference to the dll. In
both I have app.config files, BUT only mine.exe.config file is generated in \bin\Debug\ folder of exe app. What can I do to generate my.dll.config from app.config, too?

Thnx for any advice.

Nov 15 '05 #4

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

Similar topics

8
1544
by: Dan Perl | last post by:
Here is a problem I am having trouble with and I hope someone in this group will suggest a solution. First, some code that works. 3 classes that are derived from each other (A->B->C), each one implementing only 2 methods, __init__ and setConfig. ------------------------------------------------------- #!/usr/bin/python class A (object): def __init__(self): super(A, self).__init__() self.x = 0
1
2561
by: timothy.williams | last post by:
I'm trying to install wxPython 2.5.3.1 using Python 2.3.2 on a Fedora 2 machine. I have python in a non-standard place, but I'm using --prefix with the configure script to point to where I have everything. The make install in $WXDIR seemed to go fine. I have the libxw* libraries in my lib/ directory libwx_base-2.5.so@ libwx_gtk_adv-2.5.so.3.0.0* libwx_base-2.5.so.3@ libwx_gtk_core-2.5.so@
13
3794
by: Wolfgang Kaml | last post by:
Hello All, I have been researching newsgroups and knowledgebase all morning and not found a solution that would solve the problem I have. I am having an ASP or ASPX web page that implement a counter functionality and read/insert some data in a MS Access database on that Windows 2003 server. The weird part is, as long as the web page is very short in size, I can hit the refresh button and Internet Explorer will reload the page and display...
2
2075
by: Eric Caron | last post by:
Hi Here's my problem, I create a windows service with Config.xml file. All setup for my service is in this file. I create a windows application to manage these settings (Config.XML File). This work good if the two applications are in the same folder and Config.XML is in the folder too but If not, my windows application setting don't work. In my windows form I have a Service controler components to manage my service (start, stop, ...)....
0
1148
by: Johannes H?drich | last post by:
Hello folks, i've got a tough problem with configuration the CMAB in my asp.net application. Following scenario is given: root directory (ASP.NET Application) |- web.config (access from CMAB works fine) |- /VirDir1 (NO ASP.NET Application (just a normal VirtDir)) |- web.config (no access from CMAB possible) |- execute.aspx (aspx page, which uses CMAB Config)
2
5431
by: Praveen K | last post by:
I have a problem in communicating between the C# and the Excel Interop objects. The problem is something as described below. I use Microsoft Office-XP PIA dll’s as these dll’s were been recommended by many for web applications. I create the instances of Excel, Workbook and the worksheet. And later on Release the references by “System.Runtime.InteropServices.Marshal.ReleaseComObject(Object)” and making the object as null finally....
10
409
by: Antoon Pardon | last post by:
I have the following little piece of code: class Cfg:pass #config = Cfg() def assign(): setattr(config, 'Start' , ) def foo(): config = Cfg()
2
6648
by: Ian | last post by:
Hi, I am trying to use machine.config to store database settings for a connection wrapper class I am using as part of the data layer of an n-tier system. Have added the following section to my machine.config file <appSettings> <add key ="iSpexDatabaseType" value ="SQL"/>
3
1674
by: Alok yadav | last post by:
I have an open IP and on that IP our main application is hosted. it uses ajax. in web.config file i have register ajax handlers. there are also other sites or project on that IP. now my problem is that other ASP.net projects throws error and take my web.config file as thier web.config. this server is my office server. now this create a big problem for us. Please give me the solution of that problem. how site consider their own web.config...
5
2703
by: =?Utf-8?B?VGhlIE1hbiBGcm9tIFNRTA==?= | last post by:
I'm having the darndest XML config file problem that I really need help with. I'm supporting a .NET 1.1 desktop application with its own config file, and I implement IConfigurationSectionHandler so I can have a custom config section in my config file. The IConfigurationSectionHandler.Create method just returns the 'section' XmlNode back to the consumer. The config file looks kind of like this: <?xml version="1.0" encoding="utf-8" ?>...
0
8420
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, well explore What is ONU, What Is Router, ONU & Routers main usage, and What is the difference between ONU and Router. Lets take a closer look ! Part I. Meaning of...
0
8324
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8740
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
8516
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,...
0
7353
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development projectplanning, coding, testing, and deploymentwithout human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6176
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
5642
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
4173
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
1970
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.