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

Deployment nightmares with app.config

Let's say you have a stand alone C# library project that is your
datalayer. When this library compiles it will produce
"My.DataLayer.dll" for example.

In the project you use all the new whizbang DataSet generation tools to
create some datasets, etc in your DataLayer project. When you setup a
connection string it adds a settings.settings file and na app.config to
the project which holds the connection string. Essentially the
settings.settings is a front-end to the app.config file.

Now, you compile your project and everything works, except the
app.config file is embedded into your DLL. This means you cannot take
the DLL and copy it to production or beta without first changing the
settings and regenerating the app.config and recompiling.

I read somewhere a long time ago that you can rename the app.config file
to the My.DataLayer.dll.config for example but it doesn't appear to
pickup the settings in the new config file, they are STILL embedded
within the DLL (even though the file is set to not copy and not embed).

Anyone know of a way around this?

-Keith
Jan 19 '06 #1
3 9216
Remove the config file and place it in an accessible project

"Keith Elder" <ke***@removethis.dotnetpimps.net> wrote in message
news:Uo******************************@comcast.com. ..
Let's say you have a stand alone C# library project that is your
datalayer. When this library compiles it will produce "My.DataLayer.dll"
for example.

In the project you use all the new whizbang DataSet generation tools to
create some datasets, etc in your DataLayer project. When you setup a
connection string it adds a settings.settings file and na app.config to
the project which holds the connection string. Essentially the
settings.settings is a front-end to the app.config file.

Now, you compile your project and everything works, except the app.config
file is embedded into your DLL. This means you cannot take the DLL and
copy it to production or beta without first changing the settings and
regenerating the app.config and recompiling.

I read somewhere a long time ago that you can rename the app.config file
to the My.DataLayer.dll.config for example but it doesn't appear to pickup
the settings in the new config file, they are STILL embedded within the
DLL (even though the file is set to not copy and not embed).

Anyone know of a way around this?

-Keith

Jan 19 '06 #2
That defeats the purpose of deploying a stand alone DLL though. It
should rely on some other file in another project. Plus doing that
removes the connection string from the designer.

threetoes wrote:
Remove the config file and place it in an accessible project

"Keith Elder" <ke***@removethis.dotnetpimps.net> wrote in message
news:Uo******************************@comcast.com. ..
Let's say you have a stand alone C# library project that is your
datalayer. When this library compiles it will produce "My.DataLayer.dll"
for example.

In the project you use all the new whizbang DataSet generation tools to
create some datasets, etc in your DataLayer project. When you setup a
connection string it adds a settings.settings file and na app.config to
the project which holds the connection string. Essentially the
settings.settings is a front-end to the app.config file.

Now, you compile your project and everything works, except the app.config
file is embedded into your DLL. This means you cannot take the DLL and
copy it to production or beta without first changing the settings and
regenerating the app.config and recompiling.

I read somewhere a long time ago that you can rename the app.config file
to the My.DataLayer.dll.config for example but it doesn't appear to pickup
the settings in the new config file, they are STILL embedded within the
DLL (even though the file is set to not copy and not embed).

Anyone know of a way around this?

-Keith


Jan 19 '06 #3
Hi,

A config file exist only for an executable, a DLL has no config associated.
You have a couple of options though ( I listed them in a decreasing
priority list)

1- Create an Init method for the dll
2- Create a config file only for the dll and place it in the same folder
than the dll, you can read it later and interprete the config options.
3- Create a config section in the .exe config file, the dll can read its
values from there. and they do not interfere with other dlls/ the exe
settings.
--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation

"Keith Elder" <ke***@removethis.dotnetpimps.net> wrote in message
news:Uo******************************@comcast.com. ..
Let's say you have a stand alone C# library project that is your
datalayer. When this library compiles it will produce "My.DataLayer.dll"
for example.

In the project you use all the new whizbang DataSet generation tools to
create some datasets, etc in your DataLayer project. When you setup a
connection string it adds a settings.settings file and na app.config to
the project which holds the connection string. Essentially the
settings.settings is a front-end to the app.config file.

Now, you compile your project and everything works, except the app.config
file is embedded into your DLL. This means you cannot take the DLL and
copy it to production or beta without first changing the settings and
regenerating the app.config and recompiling.

I read somewhere a long time ago that you can rename the app.config file
to the My.DataLayer.dll.config for example but it doesn't appear to pickup
the settings in the new config file, they are STILL embedded within the
DLL (even though the file is set to not copy and not embed).

Anyone know of a way around this?

-Keith

Jan 19 '06 #4

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

Similar topics

1
by: Eric Cadwell | last post by:
Can it be done? How would I make a change without compiling? Thanks, Eric Cadwell
2
by: Robert May | last post by:
I have an application that processes text strings using information in a file. I want to deploy this app using no-touch deployment. The config files and everything else are deployed just fine,...
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 ...
2
by: Keith Elder | last post by:
Let's say you have a stand alone C# library project that is your datalayer. When this library compiles it will produce "My.DataLayer.dll" for example. In the project you use all the new...
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,...
3
by: shapper | last post by:
Hello, I am using VS 2008 and and just downloaded Web Deployment Projects: http://connect.live.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=319288 I need the connection string in my...
5
by: tshad | last post by:
I have a Windows Service that I am deploying by setting a Deployment project in my solution. The problem I am having is with the app.config file. This where we store our connection string and...
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...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
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...
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: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
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: 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.