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

.Net 2.0 app.config / deployment

Hello
I created a dll assembly unsing the settings (only application settings). I
read a lot a lot about the new settings concept, but I still don't understand
it.

The settings are in two places. First in the settings file which can be
edited a gui, second in the app.config file which is used in the development
enviornment. So far so good... but...

When I deploy my application and have a <dll filename>.config file in the
same directory where my dll file is, it does not work when I change settings
in the .config file. It always uses the default settings which are still from
the development enviornment.

How can I make my dll use the settings from the .config file and not the
default settings?

Help you very much,
Peter
Jul 25 '06 #1
4 5464
Peter,

When you have a config file, you need to place your settings in the
config file for the executable. Libraries could not (and should not, IMO)
have a config file of their own, since they are working in the larger
context of the application that references them.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Peter" <Pe***@discussions.microsoft.comwrote in message
news:BD**********************************@microsof t.com...
Hello
I created a dll assembly unsing the settings (only application settings).
I
read a lot a lot about the new settings concept, but I still don't
understand
it.

The settings are in two places. First in the settings file which can be
edited a gui, second in the app.config file which is used in the
development
enviornment. So far so good... but...

When I deploy my application and have a <dll filename>.config file in the
same directory where my dll file is, it does not work when I change
settings
in the .config file. It always uses the default settings which are still
from
the development enviornment.

How can I make my dll use the settings from the .config file and not the
default settings?

Help you very much,
Peter

Jul 25 '06 #2
Peter,

Try:

Configuration = ConfigurationManager.OpenExeConfiguration(
Assembly.GetExecutingAssembly().Location );

HTH
Andy

Peter wrote:
Hello
I created a dll assembly unsing the settings (only application settings). I
read a lot a lot about the new settings concept, but I still don't understand
it.

The settings are in two places. First in the settings file which can be
edited a gui, second in the app.config file which is used in the development
enviornment. So far so good... but...

When I deploy my application and have a <dll filename>.config file in the
same directory where my dll file is, it does not work when I change settings
in the .config file. It always uses the default settings which are still from
the development enviornment.

How can I make my dll use the settings from the .config file and not the
default settings?

Help you very much,
Peter
Jul 25 '06 #3
Ian
That's an interesting point. I am trying to store configuration information
for a data layer library that needs to be configured to access different
databases/servers, with stored userId and password, etc. How can I do this
for such 'behind the scenes' library classes without using a different config
file for each different project/module that calls the data access classes?

Should I be using machine.config or something?

Thanks

Ian

"Nicholas Paldino [.NET/C# MVP]" wrote:
Peter,

When you have a config file, you need to place your settings in the
config file for the executable. Libraries could not (and should not, IMO)
have a config file of their own, since they are working in the larger
context of the application that references them.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Peter" <Pe***@discussions.microsoft.comwrote in message
news:BD**********************************@microsof t.com...
Hello
I created a dll assembly unsing the settings (only application settings).
I
read a lot a lot about the new settings concept, but I still don't
understand
it.

The settings are in two places. First in the settings file which can be
edited a gui, second in the app.config file which is used in the
development
enviornment. So far so good... but...

When I deploy my application and have a <dll filename>.config file in the
same directory where my dll file is, it does not work when I change
settings
in the .config file. It always uses the default settings which are still
from
the development enviornment.

How can I make my dll use the settings from the .config file and not the
default settings?

Help you very much,
Peter


Jul 25 '06 #4
Ian,

You could use machine.config, and that will set the "default" for that
machine, should there be no section in the application configuration file.
Those settings will always override the machine.config settings.

If you have your application libraries being used in many different
areas, and you want to set the defaults through a config file, then
machine.config is a good way to do it.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Ian" <ia********@NOSPAM.aol.comwrote in message
news:CD**********************************@microsof t.com...
That's an interesting point. I am trying to store configuration
information
for a data layer library that needs to be configured to access different
databases/servers, with stored userId and password, etc. How can I do this
for such 'behind the scenes' library classes without using a different
config
file for each different project/module that calls the data access classes?

Should I be using machine.config or something?

Thanks

Ian

"Nicholas Paldino [.NET/C# MVP]" wrote:
>Peter,

When you have a config file, you need to place your settings in the
config file for the executable. Libraries could not (and should not,
IMO)
have a config file of their own, since they are working in the larger
context of the application that references them.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Peter" <Pe***@discussions.microsoft.comwrote in message
news:BD**********************************@microso ft.com...
Hello
I created a dll assembly unsing the settings (only application
settings).
I
read a lot a lot about the new settings concept, but I still don't
understand
it.

The settings are in two places. First in the settings file which can be
edited a gui, second in the app.config file which is used in the
development
enviornment. So far so good... but...

When I deploy my application and have a <dll filename>.config file in
the
same directory where my dll file is, it does not work when I change
settings
in the .config file. It always uses the default settings which are
still
from
the development enviornment.

How can I make my dll use the settings from the .config file and not
the
default settings?

Help you very much,
Peter



Jul 25 '06 #5

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

Similar topics

2
by: Darwin Fisk | last post by:
I have an app that is deployed that uses .config file settings. I have an update of that app that I am installing using a setup and deployment project. The basic setup process works fine. Now I...
3
by: Marek | last post by:
Hi there, my WinForm application has to be installed in "no-touch-deployment" mode, so users can run it from the web. I need to read application's .config file but it does not work in ...
6
by: Luis Esteban Valencia | last post by:
Hi, I want in debug mode debug=true. In release (production), no reason debug to be true but the questions are: 1. Does it slow the application (holding debug=true) 2. If yes, how can I solve...
5
by: ad | last post by:
I am developing web applicaiton with VS2005. The WebApp used a ClassLibrary in another project. There are some TableAdapter in the classlibrary, and the TableAdapter use the connection in the...
6
by: Joel H | last post by:
We have several settings in web.config that are different on the developer side than the production side. Our website sourcecode is under sourcesafe control, so before we code, we check out the...
2
by: Oleg.Ogurok | last post by:
Hi there, When a Windows App is compiled in Visual Studio 2005, app.config is renamed to MyAppName.exe.config and placed under either bin\Debug or bin\Release, depending on the currently...
12
by: dbuchanan | last post by:
Hello, (Is this the proper newsgroup?) === Background === I am building a solution with two projects. One project is my data access layer which contains my DataSet as an xsd file. The XSD...
3
by: =?Utf-8?B?RHVrZSAoQU4yNDcp?= | last post by:
I've added a web deployment project and want to use the config section replacement but I'm obviously not understanding something. I have set up an alternate appSettings file,...
1
by: =?Utf-8?B?Q2h1Y2sgUA==?= | last post by:
I have an asp.net solution with a web deployment project. When we try to build/debug, we get the message: An editor or project is attempting to check out a file that is modified in memory,...
3
by: =?Utf-8?B?bXVzb3NkZXY=?= | last post by:
Hi I've been reading about various ways in which people can have multiple web.config "sections" for different scenarios (configSource proerty, etc). In my situation, I just have a dev and...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
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,...
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
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,...
0
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...
0
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...

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.