title: How to skip Target in .csproj when --no-build is passed?
body: <p>How can I stop commands in <code>&lt;Exec&gt;</code> tags within a <code>&lt;Target&gt;</code> in my .csproj file from running when I run <code>dotnet publish --no-build ...</code>? Can I stop the entire <code>&lt;Target&gt;</code> section from being used?</p>
  <p>Sample:</p>
  <pre class="lang-xml prettyprint-override"><code>&lt;Target Name=&quot;BuildSpa&quot; BeforeTargets=&quot;Build&quot; AfterTargets=&quot;ComputeFilesToPublish&quot; Condition=&quot;'$(Configuration.ToUpper())' == 'RELEASE'&quot;&gt;
      &lt;Exec WorkingDirectory=&quot;$(SpaRoot)&quot; Command=&quot;npm install&quot; /&gt;
      &lt;Exec WorkingDirectory=&quot;$(SpaRoot)&quot; Command=&quot;npm run build&quot; /&gt;
  &lt;/Target&gt;
  </code></pre>