473,837 Members | 1,677 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Wiring up an App.Config file - deploying the App.Config file

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,
xsc, cs).

The other project has a reference to the data access layer project and
contains my windows forms.

=== My Goal === (My two questions further down address parts of this goal.)
I want to add an app config file to the solution and have it contain the
connectionstrin g. I want to be able to edit this App.Config file after
deployment so that I can connect to the desired target database.

=== Question #1 ===
This question is about adding an App.Config file after the XSD file is
already configured:

When I create an XSD file after I add an App.Config file the
connectionStrin g is automatically added to the config file and the XSD is
automatically wired up to the App.Config file.

However, when the XSD file is created first teh XSD and the App.Config file
are independant form one another - no automatic wiring occurs. How can I get
the App.Config file wired up to the XSD file? - I cannot edit any of the
files associated with the XSD file because the code is auto-generated.

#1) How do I add a App.Config file to a data access layer project with an
existing XSD file and have them appropriately wired up to each other?

=== Question #2 ===
This question is about deployment of the application when there is an
App.Config file in the data access layer:

The following test solution scenario illustrates my problem:

I created a test solution where I added a data access layer project (DAL)
and added the App.Config file before building the XSD file. I built the XSD
file by adding a table to the design surface. (the app.config and the xsd
are automatically wired up properly.) Then I added a windows form project
(WinFrmPrj) and add a reference to the DAL and added a form with a
dataGridView and wired it up to display a table of data. I built a Release
version of the project.

Looking at the respective bin\release folder structures I see the following:

DAL\bin\Release
- DAL.dll
- DAL.dll.config
- DAL.pdb

WinFrmPrj\bin\r elease
- DAL.dll
- DAL.pdb
- WinFrmPrj.exe
- WinFrmPrj.pdb
- WinFrmPrj.vshos t.exe

The contents of the second folder "WinFrmPrj\bin\ release" is what gets
deployed (as I understand), therefore the config file is not available! So
when I deploy to the target machine I have no config file to edit to target
the application to the desired database.

#2) How do I have the 'DAL.dll.config ' or any editable config file available
after deployment so that it can be edited

Thank you for your help.

dbuchanan

Jul 6 '07
12 13443
Hi dbuchanan,

As Nick pointed out, for Settings, you can use the Settings Designer to
manually copy the same entries from your DAL project to the main
application project. For other settings, you will have open the .config
file in editor and copy relevant elements manually.

Regards,
Walter Wang (wa****@online. microsoft.com, remove 'online.')
Microsoft Online Community Support

=============== =============== =============== =====
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
=============== =============== =============== =====

This posting is provided "AS IS" with no warranties, and confers no rights.

Jul 11 '07 #11
On Jul 7, 7:52 am, "dbuchanan" <dbucha...@news group.nospamwro te:
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,
xsc, cs).

The other project has a reference to the data access layer project and
contains my windows forms.

=== My Goal === (My two questions further down address parts of this goal.)
I want to add anapp configfile to the solution and have it contain the
connectionstrin g. I want to be able to edit thisApp.Configf ile after
deployment so that I can connect to the desired target database.

=== Question #1 ===
This question is about adding anApp.Configfil e after the XSD file is
already configured:

When I create an XSD file after I add anApp.Configfil e the
connectionStrin g is automatically added to the config file and the XSD is
automatically wired up to theApp.Configfi le.

However, when the XSD file is created first teh XSD and theApp.Configfi le
are independant form one another - no automatic wiring occurs. How can I get
theApp.Configfi le wired up to the XSD file? - I cannot edit any of the
files associated with the XSD file because the code is auto-generated.

#1) How do I add aApp.Configfile to a data access layer project with an
existing XSD file and have them appropriately wired up to each other?

=== Question #2 ===
This question is about deployment of the application when there is anApp.Configfil e in the data access layer:

The following test solution scenario illustrates my problem:

I created a test solution where I added a data access layer project (DAL)
and added theApp.Configfi le before building the XSD file. I built the XSD
file by adding a table to the design surface. (theapp.configa nd the xsd
are automatically wired up properly.) Then I added a windows form project
(WinFrmPrj) and add a reference to the DAL and added a form with a
dataGridView and wired it up to display a table of data. I built a Release
version of the project.

Looking at the respective bin\release folder structures I see the following:

DAL\bin\Release
- DAL.dll
- DAL.dll.config
- DAL.pdb

WinFrmPrj\bin\r elease
- DAL.dll
- DAL.pdb
- WinFrmPrj.exe
- WinFrmPrj.pdb
- WinFrmPrj.vshos t.exe

The contents of the second folder "WinFrmPrj\bin\ release" is what gets
deployed (as I understand), therefore the config file is not available! So
when I deploy to the target machine I have no config file to edit to target
the application to the desired database.

#2) How do I have the 'DAL.dll.config ' or any editable config file available
after deployment so that it can be edited

Thank you for your help.

dbuchanan
As the Setting.Setting s class ia a partial class, you can customise it
by providing your partial class and forget about the app.config file.

Jul 26 '07 #12
On Jul 6, 3:52 pm, "dbuchanan" <dbucha...@news group.nospamwro te:
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,
xsc, cs).

The other project has a reference to the data access layer project and
contains my windows forms.

=== My Goal === (My two questions further down address parts of this goal.)
I want to add an app config file to the solution and have it contain the
connectionstrin g. I want to be able to edit this App.Config file after
deployment so that I can connect to the desired target database.

=== Question #1 ===
This question is about adding an App.Config file after the XSD file is
already configured:

When I create an XSD file after I add an App.Config file the
connectionStrin g is automatically added to the config file and the XSD is
automatically wired up to the App.Config file.

However, when the XSD file is created first teh XSD and the App.Config file
are independant form one another - no automatic wiring occurs. How can I get
the App.Config file wired up to the XSD file? - I cannot edit any of the
files associated with the XSD file because the code is auto-generated.

#1) How do I add a App.Config file to a data access layer project with an
existing XSD file and have them appropriately wired up to each other?

=== Question #2 ===
This question is about deployment of the application when there is an
App.Config file in the data access layer:

The following test solution scenario illustrates my problem:

I created a test solution where I added a data access layer project (DAL)
and added the App.Config file before building the XSD file. I built the XSD
file by adding a table to the design surface. (the app.config and the xsd
are automatically wired up properly.) Then I added a windows form project
(WinFrmPrj) and add a reference to the DAL and added a form with a
dataGridView and wired it up to display a table of data. I built a Release
version of the project.

Looking at the respective bin\release folder structures I see the following:

DAL\bin\Release
- DAL.dll
- DAL.dll.config
- DAL.pdb

WinFrmPrj\bin\r elease
- DAL.dll
- DAL.pdb
- WinFrmPrj.exe
- WinFrmPrj.pdb
- WinFrmPrj.vshos t.exe

The contents of the second folder "WinFrmPrj\bin\ release" is what gets
deployed (as I understand), therefore the config file is not available! So
when I deploy to the target machine I have no config file to edit to target
the application to the desired database.

#2) How do I have the 'DAL.dll.config ' or any editable config file available
after deployment so that it can be edited

Thank you for your help.

dbuchanan
I ran into this issue a while back. There are many different solutions
to getting your .dll to read a config file so you can deploy it
independently of your application. I found the second easiest thing to
do was to write my own parser to read the application settings and
connection strings for the config file. The easiest thing to do, that
was disused is to include your settings at the application level
(where the .exe project is at). There is an article out there about
creating a separate app that your dll is running in that can read it's
settings but it's more complicated than it is worth.

Jul 27 '07 #13

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

Similar topics

0
1428
by: Chris Fink | last post by:
I am writing a c# unattended windows application and I would like to write an event to handle any type of application error by gracefully degrading and writing a message to an error log. Errors should never be visible or pause program execution, in case of an error program should just exit and write error to logfile. I would like to accomplish this by writing an event that handles any type of exception (both custom exceptions that I define...
4
3003
by: Chris V | last post by:
I'm having a problem deploying my ASP.NET application to a WIN2k server. (IIS5 .NET 1.1) When I try to access ConfigurationSettings.AppSettings("WhateverValue") I get an "Object reference not set to an instance of an object." message I thought this may have been to do with Virtual Directory settings but I've got the folder set as an application in IIS and asp.net is installed and working. My web.config file is Not Marked read-only and...
4
2035
by: Dominic | last post by:
Suppose I have a web.config. I'd like to move some configuration settings from this web.config and put it another XML file (say, common.xml). Now, is there any way that I can modify the web.config such that it will include (dynamically) the common.xml? In other words, System.Configuration.ConfigurationSettings.GetConfig can read settings in common.xml as they were in web.config. Furthermore, when I load web.config into XML DOM object,...
5
1558
by: Mossman | last post by:
Hello, I am not sure what to look at next on this issue so any information and/or links to web sites would be greatly appreciated. I have developed an ASP.NET application using VB.NET. I tested and debugged it successfully on my PC using IIS. Once I was ready to deploy the application, I created a staging virtual directory on my D: drive and used the Copy Project menu selection (Project - Copy Project) to copy only files needed to...
8
3172
by: Graham | last post by:
I noticed a similar post awhile ago and in terms of my problem it wasnt a suitable answer so I will ask again. I have VS2005 running a on development machine in my office where I do all my development on existing and new applications. This environment also has its own Sql Server with dev versions of all our live Databases. Our live production server also its own Sql Server, these 2 Sql Servers are kept completely separate (for obvious...
0
1335
by: Matthew | last post by:
I have created two configurations. One is called Release-Internal and one is called Release-External. I also have two config files named Internal.config and External.config. The difference in the files is that the server locations included within each file are either the local internal addresses or the external public addresses. I've set the "override file" property in the configuration option property page to be Interal.config for...
1
2299
by: savajx1 | last post by:
I am using the new "web deployment addin" in VS 2005 to output my web site. The web site is correctly output (assemblies generated in the \bin subdirectory). The web site on my developement machine (WIN 2K OS) can be accessed and works correctly from other workstations (i.e no problem here). The problem: When deploying the web site (by just copying the correct subdirectories and creating the application in IIS 6) on 2 dffering Windows...
3
9248
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...
1
8787
by: M O J O | last post by:
Hi, I've have searched google, but can't find a solution to my problem. Om my develloper machine, I use one app.config, but when I deploy, I need to deploy another app.config. The reason is, that on my develloper machine, my app.config sqlconnection is pointing to my (local) database and I have several settings like "Debug=True", but when I deploy (using ClickOnce), I need to use an
0
10883
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
10579
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
10633
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
10276
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9412
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 project—planning, coding, testing, and deployment—without 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...
0
5674
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
5852
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
4050
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3126
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.