Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Note: The following applies to VS2010 and publishing web-application projects with the "Web Deploy" publish method selected in the 'Build/Publish {projectname}' dialog.</p> <p>Julien Hoarau's correct in that "Publish" is NOT the name of the msbuild target invoked in the above case; the actual target name is <strong>"MSDeployPublish"</strong>.</p> <p>Therefore, you have to define a <strong>"Target"</strong> element whose <strong>"AfterTarget"</strong> attribute's value is set to <strong>"MSDeployPublish"</strong> - the "Name" attribute's value does <em>not</em> matter (as long as it's unique among target names).</p> <p>Here's how to do it:</p> <ul> <li>Open the project file (e.g. *.csproj) in a text/XML editor and, just before the closing <code>&lt;/Project&gt;</code> tag, add a <code>&lt;Target Name="CustomPostPublishAction" AfterTargets="MSDeployPublish"&gt;</code> element; pick a name of your choice for "CustomPostPublishAction".</li> <li>Add a so-called Task child element that performs the desired action; for instance, to add a command to be passed to cmd.exe, use an <code>&lt;Exec Command="..." /&gt;</code> element.</li> </ul> <p>Example:</p> <pre><code>&lt;Target Name="CustomPostPublishActions" AfterTargets="MSDeployPublish" &gt; &lt;Exec Command="echo Post-PUBLISH event: Active configuration is: $(ConfigurationName)" /&gt; &lt;/Target&gt; </code></pre> <p>Note:</p> <ul> <li>In command strings, use XML entity(?) references in place of characters that would break XML parsing, e.g. "&amp;gt" in place of "&lt;".</li> <li>For documentation of the <code>&lt;Target&gt;</code> element in general, see <a href="http://msdn.microsoft.com/en-us/library/t50z2hka.aspx">http://msdn.microsoft.com/en-us/library/t50z2hka.aspx</a></li> <li>Task-elements reference here: <a href="http://msdn.microsoft.com/en-us/library/7z253716.aspx">http://msdn.microsoft.com/en-us/library/7z253716.aspx</a> </li> <li>In general, if you need to determine the name of the msbuild.exe target that is actually invoked by Visual Studio 2010, do the following: <ul> <li>Go to Tools/Options..., Project and Solutions/Build and Run, select 'Detailed' (or, for even more information, 'Diagnostic') from the dropdown list labeled 'MSBuild project build output verbosity.</li> <li>After running the build/publish action, e.g. Build/Publish, examine the Output window for the <em>last</em> occurrence of the string "Done building target" to determine the top-level target that was invoked.</li> </ul></li> </ul>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

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