Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / General / September 2007

Tip: Looking for answers? Try searching our database.

Web deployment project - config section replacement files

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Duke (AN247) - 31 Aug 2007 09:20 GMT
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
Steven Cheng[MSFT] - 03 Sep 2007 08:17 GMT
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/subscriptions/managednewsgroups/default.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/subscriptions/support/default.aspx.

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

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

--------------------

>From: =?Utf-8?B?RHVrZSAoQU4yNDcp?= <Duke@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.
[quoted text clipped - 10 lines]
>Thanks,
>Andrew
Duke (AN247) - 03 Sep 2007 08:52 GMT
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
Steven Cheng[MSFT] - 03 Sep 2007 10:04 GMT
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?= <Duke@newsgroup.nospam>
>References:  <23C03B1C-1D23-4279-A287-4EED9765D49A@microsoft.com>
<4n7QQqf7HHA.360@TK2MSFTNGHUB02.phx.gbl>
>Subject: RE: Web deployment project - config section replacement files
>Date: Mon, 3 Sep 2007 00:52:00 -0700

>Thanks Steven,
>
[quoted text clipped - 4 lines]
>Cheers,
>Andrew

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.