473,695 Members | 1,929 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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.d ll" 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.settin gs file and na app.config to
the project which holds the connection string. Essentially the
settings.settin gs 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.dl l.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 9239
Remove the config file and place it in an accessible project

"Keith Elder" <ke***@removeth is.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.d ll"
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.settin gs file and na app.config to
the project which holds the connection string. Essentially the
settings.settin gs 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.dl l.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***@removeth is.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.d ll"
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.settin gs file and na app.config to
the project which holds the connection string. Essentially the
settings.settin gs 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.dl l.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***@removeth is.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.d ll"
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.settin gs file and na app.config to
the project which holds the connection string. Essentially the
settings.settin gs 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.dl l.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
1533
by: Eric Cadwell | last post by:
Can it be done? How would I make a change without compiling? Thanks, Eric Cadwell
2
1942
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, but the CGT file (compiled Grammar Table) is not, and the program crashes when it attempts to read this file. Is there any way to have this file loaded as needed? With no touch deployment, how do you copy files that aren't assemblies down to...
3
2172
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 no-touch-deployment. Could anyone give me directions to documentation piece (or article) that explains how to implement app .config file reading in no-touch-deployment ? (just to clarif the issue, my app is not ASP.NET) I'd appreciate any help, thank you....
2
11990
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 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...
6
2419
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 web.config and change our connection strings to point to development databases, and change "debug=true". Before we deploy, we change everything back. We can't dynamically select the proper connection string in code because we are using the...
2
1856
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 selected Configuration (Debug or Release). Is there a way to have separate app.config files for each configuration (Debug and Release) and instruct VS/MSBuild to copy the right one during a build?
12
13429
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 file was built by draging tables from the Data Sources pane. Auto-generated code created the files associated wtih the XSD file (xss,
3
2284
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, test.appSettings.config, and when I build the appSettings are correctly overridden, but I also end up with a copy of test.appSettings.config in my web site. If I have config sections for several environments they all get copied. How do I stop the copy? I wondered...
3
2424
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 web site Web.config file to be replaced. So I created a new file named ConnectionStrings.config that contains only the following:
5
2158
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 folder locations. My development app.config is different from my clients. When I send him an msi file, I have to either add the clients app.config file into my project in 2 locations (as I am running as an exe as well as a
0
8587
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
9140
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
9005
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
6511
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
5847
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
4351
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...
0
4599
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3025
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2291
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.