473,614 Members | 2,335 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Web deployment project - config section replacement files

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.appSetting s.config, and
when I build the appSettings are correctly overridden, but I also end up with
a copy of test.appSetting s.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 if the file should be located within the
web deployment project but you can't add files to it.

What have I missed?
Thanks,
Andrew
Aug 31 '07 #1
3 2275
Hi Andrew,

From your description, you're using vs 2005/ASP.NET web deployment project
to precompile the web site project and wonder how to use the "section
replacement" feature and avoid letting the separate config section file be
copied to the compiled output folder, right?

Based on my research, the "section replacement" feature of WDP does support
you to supply a full qualified path instead a relative path(just simply the
filename). For example, you can use the following line to supply a separate
config file(in an external folder) in the WDP's section replacement setting
dialog:
>>>>>>>>>>
system.web/pages=e:\temp\m ypages.config;
<<<<<<<

Thus, at runtime, the WDP will pickup the configuration setting from that
file (in the external dir) and replace the certain section with the content
in that file. Also, after the precompilation, that separate file (in
external folder) will not be copiled to the application's precompile output
directory. I've tested it on my local environment and it works well.

You can try it to see whether it fits your requirement and feel free to let
me know if you need any further help/

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead

=============== =============== =============== =====

Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.aspx#notif
ications.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscripti...t/default.aspx.

=============== =============== =============== =====
This posting is provided "AS IS" with no warranties, and confers no rights.
--------------------
>From: =?Utf-8?B?RHVrZSAoQU4 yNDcp?= <Du**@newsgroup .nospam>
Subject: Web deployment project - config section replacement files
Date: Fri, 31 Aug 2007 01:20:00 -0700
>
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.appSetting s.config, and
when I build the appSettings are correctly overridden, but I also end up
with
>a copy of test.appSetting s.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 if the file should be located within
the
>web deployment project but you can't add files to it.

What have I missed?
Thanks,
Andrew
Sep 3 '07 #2
Thanks Steven,

I wanted to avoid a fully qualified path so I modified the wdproj file to
copy the external config file in from a relative path before the build, and
then delete the extra file after the build.

Cheers,
Andrew
Sep 3 '07 #3
Thanks for your quick reply Andrew,

Yes, using post-build/pre-build events is a thorough solution as you can
freely do many custom tasks there. I haven't mentioned it eariler in case
you may look for a more direct and simple approach :)

Anyway, glad that you've find a workable approach, if you meet any new
problem need help, please feel free to post here.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead
This posting is provided "AS IS" with no warranties, and confers no rights.

--------------------
>From: =?Utf-8?B?RHVrZSAoQU4 yNDcp?= <Du**@newsgroup .nospam>
References: <23************ *************** *******@microso ft.com>
<4n************ *@TK2MSFTNGHUB0 2.phx.gbl>
>Subject: RE: Web deployment project - config section replacement files
Date: Mon, 3 Sep 2007 00:52:00 -0700
>
Thanks Steven,

I wanted to avoid a fully qualified path so I modified the wdproj file to
copy the external config file in from a relative path before the build,
and
>then delete the extra file after the build.

Cheers,
Andrew
Sep 3 '07 #4

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

Similar topics

0
1161
by: Lloyd Dupont | last post by:
Hi! I'm a newbie ;-) I started to write an excessively simple ASP.NET "utility" web app, named WebSite1. Inside of it I'm using FreeTextBox (http://www.freetextbox.com) Then I modified the Web.config file as follow (to recognize the tag FTB): === <system.web> <pages> <controls> <add tagPrefix="FTB" namespace="FreeTextBoxControls" assembly="FreeTextBox"/>
0
1222
by: Stéphane KIES | last post by:
Hello, I cannot replace the <system.web> section using the Enable Web.config file replacement feature of Web Project Deployment for Visual Studio 2005. appSettings=myFile.config works but system.web=myFile.config generates the following error : error : web.config(1): error WDP00002: missing section system.web Is it possible to replace the system.web section. What is the correct syntax.
6
2418
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...
1
2603
by: Grant | last post by:
Hi, When using the web.config file section replacement functionality, we are unable to replace any section other than appSettings. We have tried compilation, system.web etc. Our section replace code is appSettings=stage.appSettings.config compilation=stage.compilation.config
0
2099
by: Brian McCullough | last post by:
Hello, I have a Web Deployment Project (WDP) for my Web Site Project (WSP) (not a Web Application Project). I put an additional prodAppSettings.config file on my development machine and enabled web.config file section replacements for the appSettings element. The replacement is working fine, except, that it is copying the prodAppSettings.config file to the output directory. Is there a way to prevent my prodAppSettings.config file...
0
1017
by: Stupid48 | last post by:
I like the web deployment projects add-in for VS 2005. The web.config section replacement is especially useful. I'm a bit confused about an aspect of this. We develop against remote web servers and Attach to the remote debugger remotely. This whole deployment thing does not take that into account (at least from I can undersstand). In VS 2003, we could switch between release and debug on the same web server and still run the site from...
0
1860
by: =?Utf-8?B?SWFu?= | last post by:
Hi, I'm using VS 2005 SP1 with Web Deployment Project download v8.0.51103, according to the Add/Remove programs applet. I've got a file based web service project with an associated web deployment project. I want to build my release version of the wdp with debug info so I can run NUnit on the output and doing that causes the wdp build to set <compilation debug="true"/in the web.config file. I've setup a replace config section...
0
2162
by: =?Utf-8?B?SXJhIEdyb2xsbWFu?= | last post by:
While debugging why a web.config section replacement was not happening in the real web application, I tried a simplified case, no replacement is enabled and the connection string is not showing up? Suggestions about what could be happening? The code: Dim rootWebConfig As System.Configuration.Configuration rootWebConfig = System.Web.Configuration.WebConfigurationManager.OpenWebConfiguration(Nothing)
1
1275
by: Justin Friel | last post by:
Hi, I have been using a web deployment project with Visual Studio 2008 Standard Edition to deploy a website. There are a couple of settings which aren't working exactly as I expected and was wondering if anyone on the list has more info. First, I'm trying to use the Web.config file section replacements feature to replace a custom section in my config file. The project can replace the appsettings and connectionstrings sections just...
0
8640
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
8589
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
8287
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
8443
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
7114
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
4058
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
4136
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2573
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
0
1438
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.