Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Web deployment project - config section replacement files

Reply
Thread Tools

Web deployment project - config section replacement files

 
 
=?Utf-8?B?RHVrZSAoQU4yNDcp?=
Guest
Posts: n/a
 
      08-31-2007
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 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
 
Reply With Quote
 
 
 
 
Steven Cheng[MSFT]
Guest
Posts: n/a
 
      09-03-2007
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\mypages.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?RHVrZSAoQU4yNDcp?= <>
>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.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 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
>


 
Reply With Quote
 
 
 
 
=?Utf-8?B?RHVrZSAoQU4yNDcp?=
Guest
Posts: n/a
 
      09-03-2007
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
 
Reply With Quote
 
Steven Cheng[MSFT]
Guest
Posts: n/a
 
      09-03-2007
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?RHVrZSAoQU4yNDcp?= <>
>References: <23C03B1C-1D23-4279-A287->

<>
>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
>


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
section with in a section config file and reading that config file kampy Python 9 10-19-2012 10:59 PM
web deployment project, web.config section replacement is not work Ira Grollman ASP General 0 11-26-2007 04:16 PM
web.config section replacement =?Utf-8?B?Q2h1Y2sgUA==?= ASP .Net 3 08-07-2007 02:59 AM
Web Deployment Project replace config section wdp00002 error =?Utf-8?B?SWFu?= ASP .Net 0 07-01-2007 10:12 AM
Web Deployment Project and web.config file section replacements?? Brian McCullough ASP .Net 0 02-16-2007 09:55 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57