I am trying to replicate the exact functionality of this dialogue in Visual Studio 2008 in a build script:
This is an ASP.NET web site, not a web application.
I have Googled around this and turned up quite a bit of stuff involving MSBuild, but this all seems to concern solutions laid out as ASP.NET Web Applications:
http://www.driebier.net/post/Using-MSBuild-to-deploy-visual-studio-2005-web-applications.aspx http://blog.donnfelker.com/post/TFS-Build-Not-Publishing-Web-Applications.aspx
This article seems to be relevant to ASP.NET Web Sites, but I find that I'm getting an error when trying to build using those suggestions:
C:devT&A>msbuild /t:_CopyWebApplication /property:OutDir=c:empaweb /prope rty:WebProjectOutputDir=c:empaweb Microsoft (R) Build Engine Version 3.5.30729.1 [Microsoft .NET Framework, Version 2.0.50727.3074] Copyright (C) Microsoft Corporation 2007. All rights reserved. Build started 22/04/2009 11:50:42. Project "C:devT&ATAWeb.sln" on node 0 (_CopyWebApplication target(s)). Building solution configuration "Debug|.NET". C:devT&ATAWeb.sln : error MSB4057: The target "_CopyWebApplication" does not exist in the project. Done Building Project "C:devT&ATAWeb.sln" (_CopyWebApplication target(s)) -- FAILED. Build FAILED. "C:devT&ATAWeb.sln" (_CopyWebApplication target) (1) -> C:devT&ATAWeb.sln : error MSB4057: The target "_CopyWebApplication" does n ot exist in the project. 0 Warning(s) 1 Error(s) Time Elapsed 00:00:00.06
The solution I'm trying to publish (inherited, not my own) doesn't have .csproj files (where I could import the _CopyWebApplication target from C:Program Files (x86)MSBuildMicrosoftVisualStudiov9.0WebApplicationsMicrosoft.WebApplication.targets)
Perhaps this is a Visual Studio 2005/2008 difference?
Anyway, I feel that I'm going down the wrong path there.
Essentially I just need to achieve exactly what the above dialogue does, but from the command line.
Thanks very much
See Question&Answers more detail:os