I thought I would post another solution that I found, I updated this solution to include the log file.
This is similar to Publish a web application from the command line , but just cleared and added the log file. also check the original source http://www.digitallycreated.net/Blog/59/locally-publishing-a-vs2010-asp.net-web-application-using-msbuild
Create MSBuild_publish_site.bat (specify it as you like) in the root project of your web application
set msBuildDir=%WINDIR%\Microsoft.NET\Framework\v4.0.30319 set destPath=C:\Publish\MyWebBasedApp\ :: clear existing publish folder RD /S /Q "%destPath%" call %msBuildDir%\msbuild.exe MyWebBasedApp.csproj "/p:Configuration=Debug;PublishDestination=%destPath%;AutoParameterizationWebConfigConnectionStrings=False" /t:PublishToFileSystem /l:FileLogger,Microsoft.Build.Engine;logfile=Manual_MSBuild_Publish_LOG.log set msBuildDir= set destPath=
Update the MyWebBasedApp.csproj web application project file by adding the following tag to the <Import Project=
<Target Name="PublishToFileSystem" DependsOnTargets="PipelinePreDeployCopyAllFilesToOneFolder"> <Error Condition="'$(PublishDestination)'==''" Text="The PublishDestination property must be set to the intended publishing destination." /> <MakeDir Condition="!Exists($(PublishDestination))" Directories="$(PublishDestination)" /> <ItemGroup> <PublishFiles Include="$(_PackageTempDir)\**\*.*" /> </ItemGroup> <Copy SourceFiles="@(PublishFiles)" DestinationFiles="@(PublishFiles->'$(PublishDestination)\%(RecursiveDir)%(Filename)%(Extension)')" SkipUnchangedFiles="True" /> </Target>
this works better for me than other solutions.
See the following information for more information:
1) http://www.digitallycreated.net/Blog/59/locally-publishing-a-vs2010-asp.net-web-application-using-msbuild
2) Publish a web application from the command line
3) Build a Visual Studio project through the command line
zulucoda Dec 20 '11 at 11:17 2011-12-20 11:17
source share