Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>The answer to this question can be found in the <code>Microsoft.Common.targets</code> file which can be found (depending on wether you're using the 64-bit or 32-bit framework) at: <code>C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Microsoft.Common.target</code> for 64-bit and <code>C:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets</code> for the 32-bit runtime. This file defines all the steps a build of your project undergoes. Quoting the source:</p> <pre><code>&lt;!-- ============================================================ Build The main build entry point. ============================================================ --&gt; &lt;PropertyGroup&gt; &lt;BuildDependsOn&gt; BeforeBuild; CoreBuild; AfterBuild &lt;/BuildDependsOn&gt; &lt;/PropertyGroup&gt; </code></pre> <p>The code is nice enough to explain the use of the <code>BeforeBuild</code> and <code>AfterBuild</code> target in the comments for both targets.</p> <pre><code>&lt;!-- ============================================================ BeforeBuild Redefine this target in your project in order to run tasks just before Build ============================================================ --&gt; &lt;Target Name="BeforeBuild"/&gt; &lt;!-- ============================================================ AfterBuild Redefine this target in your project in order to run tasks just after Build ============================================================ --&gt; &lt;Target Name="AfterBuild"/&gt; </code></pre> <p>This is followed by the definition of the <code>CoreBuild</code> target:</p> <pre><code>&lt;PropertyGroup&gt; &lt;CoreBuildDependsOn&gt; BuildOnlySettings; PrepareForBuild; PreBuildEvent; ResolveReferences; PrepareResources; ResolveKeySource; Compile; UnmanagedUnregistration; GenerateSerializationAssemblies; CreateSatelliteAssemblies; GenerateManifests; GetTargetPath; PrepareForRun; UnmanagedRegistration; IncrementalClean; PostBuildEvent &lt;/CoreBuildDependsOn&gt; &lt;/PropertyGroup&gt; </code></pre> <p>So the <code>Build</code> target is just a wrapper around the <code>CoreBuild</code> target to enable you to perform custom steps just before or after the <code>CoreBuild</code> target. As can be seen above the <code>PreBuildEvent</code> and <code>PostBuildEvent</code> are listed as dependencies of the <code>CoreBuild</code> target. The dependencies of the <code>Compile</code> target are defined as follows:</p> <pre><code>&lt;PropertyGroup&gt; &lt;CompileDependsOn&gt; ResolveReferences; ResolveKeySource; SetWin32ManifestProperties; _GenerateCompileInputs; BeforeCompile; _TimeStampBeforeCompile; CoreCompile; _TimeStampAfterCompile; AfterCompile &lt;/CompileDependsOn&gt; &lt;/PropertyGroup&gt; </code></pre> <p>Again <code>BeforeCompile</code> and <code>AfterCompile</code> are commented in the code:</p> <pre><code>&lt;!-- ============================================================ BeforeCompile Redefine this target in your project in order to run tasks just before Compile. ============================================================ --&gt; &lt;Target Name="BeforeCompile"/&gt; &lt;!-- ============================================================ AfterCompile Redefine this target in your project in order to run tasks just after Compile. ============================================================ --&gt; &lt;Target Name="AfterCompile"/&gt; </code></pre> <p>Given this information I do not know why AppHarbor does not support <code>Pre-, PostBuildEvent</code> while the <code>Build</code> can be modified using <code>Before-, AfterBuild</code>. </p> <p>Choosing which <code>Target</code> to override for which scenario depends on the moment during the build at which you wish to perform your given task. The targets do not have specific restrictions and/or benefits as to what they can accomplish. Apart from the fact that they can adapt <code>ItemGroup</code>'s or properties that were defined/filled by previous steps.</p> <p>Using nuget to bring in packages is probably best performed before the build tries to resolve the projects dependencies. So <code>BeforeCompile</code> is not a good candidate for this kind of action. </p> <p>I hope this sheds some light on the matter. Found another nice explanation on <a href="http://msdn.microsoft.com/en-us/library/ms366724(v=vs.80).aspx" rel="noreferrer">MSDN</a></p>
    singulars
    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. 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