Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>I thought I'd post a another solution that I found, I've updated this solution to include a log file.</p> <p>This is similar to <a href="https://stackoverflow.com/questions/7076971/publish-a-web-application-from-the-command-line">Publish a Web Application from the Command Line</a>, but just cleaned up and added log file. also check out original source <a href="http://www.digitallycreated.net/Blog/59/locally-publishing-a-vs2010-asp.net-web-application-using-msbuild" rel="nofollow noreferrer">http://www.digitallycreated.net/Blog/59/locally-publishing-a-vs2010-asp.net-web-application-using-msbuild</a></p> <p><strong>Create an MSBuild_publish_site.bat (name it whatever) in the root of your web application project</strong></p> <pre><code>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= </code></pre> <p><strong>Update your Web Application project file MyWebBasedApp.csproj by adding the following xml</strong> under the <code>&lt;Import Project=</code> tag</p> <pre><code>&lt;Target Name="PublishToFileSystem" DependsOnTargets="PipelinePreDeployCopyAllFilesToOneFolder"&gt; &lt;Error Condition="'$(PublishDestination)'==''" Text="The PublishDestination property must be set to the intended publishing destination." /&gt; &lt;MakeDir Condition="!Exists($(PublishDestination))" Directories="$(PublishDestination)" /&gt; &lt;ItemGroup&gt; &lt;PublishFiles Include="$(_PackageTempDir)\**\*.*" /&gt; &lt;/ItemGroup&gt; &lt;Copy SourceFiles="@(PublishFiles)" DestinationFiles="@(PublishFiles-&gt;'$(PublishDestination)\%(RecursiveDir)%(Filename)%(Extension)')" SkipUnchangedFiles="True" /&gt; &lt;/Target&gt; </code></pre> <p>this works better for me than other solutions.</p> <p>Check out the following for more info:</p> <p>1) <a href="http://www.digitallycreated.net/Blog/59/locally-publishing-a-vs2010-asp.net-web-application-using-msbuild" rel="nofollow noreferrer">http://www.digitallycreated.net/Blog/59/locally-publishing-a-vs2010-asp.net-web-application-using-msbuild</a></p> <p>2) <a href="https://stackoverflow.com/questions/7076971/publish-a-web-application-from-the-command-line">Publish a Web Application from the Command Line</a></p> <p>3) <a href="https://stackoverflow.com/questions/5669765/build-visual-studio-project-through-the-command-line/5669820#5669820">Build Visual Studio project through the command line</a></p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload