CodeVerge.Net Beta


   Explore    Item Entry    Members      Register  Login  
NEWSGROUP
.NET
Algorithms-Data Structures
Asp.Net
C Plus Plus
CSharp
Database
HTML
Javascript
Linq
Other
Regular Expressions
VB.Net
XML

Free Download:




Zone: > NEWSGROUP > Asp.Net Forum > visual_studio.vs_web_deployment_projects Tags:
Item Type: NewsGroup Date Entered: 5/16/2006 4:39:21 PM Date Modified: Subscribers: 0 Subscribe Alert
Rate It:
(NR, 0)
XPoints: N/A Replies: 3 Views: 14 Favorited: 0 Favorite
Can Reply:  No Members Can Edit: No Online: Yes
4 Items, 1 Pages 1 |< << Go >> >|
kcmarshall
Asp.Net User
Excluding replacement .config files from deployment?5/16/2006 4:39:21 PM

0/0

[background]

Web deployment rookie here trying to set up my first deployment project.  I created a "QA" build configuration and want to replace the connectionStrings section of web.config.

I created a file called QAconn.config that contains the QA version of my connectionStrings section.  Set up the config replacement on the Deployment Page of the WD project and it "just worked"!

[/background]

Here's my question:  I would rather not have the QAconn.config file included in my built website and I'd like to exclude the source safe files.  I added ExcludeFromBuild commands to the .wdproj file as specified in Using Web Deployment Projects with VS2005

If I hard code the file path to the files using the path to my working directory, the files are not excluded.  If I use the $(SourceWebPhysicalPath) syntax, I get an error during my build:

Error 71 QAConn.config(1): Could not find file 'C:\Sites\Demo\QA\QAConn.config'.
The path in the error is the Output Folder for my deployment.

Is the replacement .config file being blocked from deployment before it is used for config replacement?  I created the .config file w/in my VS website project and it currently lives in the same directory as the web.config file.  Is there a better place to put this file?

Thanks!

Kevin

Pluginbaby
Asp.Net User
Re: Excluding replacement .config files from deployment?5/17/2006 8:40:47 AM

0/0

Hi,

Since MSBuild won't be able to make config replacement if you use ExcludeFromBuild on your config files, you should use something like this (will delete QA*.config after the build process, based on your QA configuration) :


<
Target
Name="AfterBuild">
  <
CallTarget Targets="DeleteConfigFiles"></CallTarget>
</
Target>

<ItemGroup>
 
<MyUnNeededDestFiles Include="$(SourceWebPhysicalPath)\$(Configuration)*.config" />
</
ItemGroup>

<Target Name="DeleteConfigFiles">
  <
Delete Files="@(MyUnNeededDestFiles->'$(OutputPath)\%(Filename)%(Extension)')"
/>
</
Target>


Laurent Duveau
M(VP+CT+CSD+CTS+CPD)
http://weblogs.asp.net/lduveau/
www.runatserver.com
kcmarshall
Asp.Net User
Re: Excluding replacement .config files from deployment?5/17/2006 3:31:53 PM

0/0

Thanks, Laurent!

Your answer didn't quite work for me but did point me in the right direction.  I got what I was looking for from the following
<Target Name="AfterBuild">
      <CallTarget Targets="DeleteConfigFiles"></CallTarget>
</Target>
<ItemGroup>
      <ConfigFilesToExclude Include="$(OutputPath)\$(Configuration)*.config" />
</ItemGroup>
<Target Name="DeleteConfigFiles">
      <Delete Files="@(ConfigFilesToExclude)" />
</Target>
Clearly, I'll need to study up on MSBuild if I want to wring all of the tasty goodness from Web Deployments. ;)

Thanks again!
Kevin
Pluginbaby
Asp.Net User
Re: Excluding replacement .config files from deployment?5/17/2006 6:09:12 PM

0/0

True this should work this way too.

To learn Web Deployment Project and MSBuild you can start by reading this :

http://waynebrantley.com/blogs/aspnetbytes/archive/2006/02/08/5.aspx


Laurent Duveau
M(VP+CT+CSD+CTS+CPD)
http://weblogs.asp.net/lduveau/
www.runatserver.com
4 Items, 1 Pages 1 |< << Go >> >|


Free Download:

Books:
ASP.NET 2.0 MVP Hacks and Tips Authors: David Yack, Joe Mayo, Scott Hanselman, Fredrik Normén, Dan Wahlin, J. Ambrose Little, Jonathan Goodyear, Pages: 400, Published: 2006
TruCluster Server Handbook Authors: Scott Fafrak, ScienceDirect (Online service, Pages: 0, Published: 2003

Web:
Excluding replacement .config files from deployment? - ASP.NET Forums Excluding replacement .config files from deployment? Last post 05-17-2006 2:09 PM by Pluginbaby. 3 replies. Sort Posts:. Oldest to newest, Newest to oldest ...
Excluding config files - ng.asp-net-forum ... Excluding replacement .config files from deployment? - ASP.NET Forums Here's my question: I would rather not have the QAconn.config file included in my ...
OCEG Technology Blog: Web Deployment Project is the answer! The description of WDPs says you can exclude files and folders from the build. ... I placed all my replacement config files (testing and production) in a ...
Using Web Deployment Projects with Visual Studio 2005 Enable Web.config file section replacement, Enables the replacement of any ..... section to a Web Deployment project, you can exclude the Test and Images ...
web.config exclude from VSS? - ng.asp-net-forum.visual_studio_2005 ... VS 2005 Web Deployment Projects - ScottGu's Blog Hi Scott, How can I exclude from a build the files that are not required for an ... web.config replacement ...
VS .NET 2005 Web Application Deployment using (Web Setup) in VS 2005 Sep 17, 2008 ... 4) The ability to customize and modify a web application’s web.config file at deployment. There is now IDE support for changing values likes ...
Keep your .config clean with external config files Jun 16, 2008 ... (BTW: the web deployment projects can do this automatically for you, just check the "Enable Web.config file section replacement" checkbox ...
VS 2005 Web Deployment Projects - ScottGu's Blog I want my web.config to be editable on the production server without provoding any other replacement config files.In the deployment section , what option ...
J2EE War file export, how to exclude certain files? When I can't do this, I can't use hot replacement and what's the point of .... I want to exclude this file from the deployment of the WAR. ...
Slide 1 Modifying configuration settings; Creating an installer. Deployment Wrinkles. Replacement config files show up in deployed application ...




Search This Site:










any comments or suggestions for this code?

i can not get outlining work in aspx file?

general dotnetnuke questions

testing dnn2.0 alpha >> ms access >> add table

portalstore 6.5

usercontrol in webpart

about treeview

how use template to create new website?

media library starter kit

impersonation during asynchronous web service calls from web parts

how to set the registry key

preventing xss - why prefer double quotes rather than single quotes

2 same web parts on same page

uploading skins - 3.08

expert help needed

dynamically loading user controls

core team chat highlights [feb 09]

no control after button click

help needed with backing up outlook email folders and settings

connection to sql express from vs2005

delegating to a custom profile provider

newbie help with structuring web application project

need to contact someone who can help with intranet

sqldatasource and membership id

3.0 best practices: when joining tables, do i create separate info and controller classes?

website project vs. web application project in visual studio.net 2005

convert createuserwizard handler from c# to vb

gridview adapter skips colum style

tabstrip control in asp.net v2

'nt authority\network service' vs 'machine name\aspnet'

 
All Times Are GMT