473,396 Members | 2,109 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,396 software developers and data experts.

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 55093
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**************@exisconsulting.com

"Bragadiru" <ad****@cims.ro> wrote in message
news:OZ**************@tk2msftngp13.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.ConfigurationFile 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.config'
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.Configuration.Install.Installer 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**************@tk2msftngp13.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.config, where assemblyname is the project output, for example,
MyLibrary.dll or MyApplication.exe. You need to modify this copy of the
..config file to affect a deployed application."
!!??????

"Bragadiru" <ad****@cims.ro> wrote in message
news:OZ**************@tk2msftngp13.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
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...
1
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...
13
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...
2
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...
0
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...
2
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...
10
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
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...
3
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...
5
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...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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...
0
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...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.