Note that there are some explanatory texts on larger screens.

plurals
  1. POBuild doesn't work from VisualStudio, but is ok from msbuild
    text
    copied!<p>From a brand new console application template in visual studio, I edited the <code>.csproj</code> to build another project like this:</p> <pre><code>... &lt;Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /&gt; &lt;Target Name="BeforeBuild"&gt; &lt;MSBuild Projects=".\other.mproj"/&gt; &lt;/Target&gt; ... </code></pre> <p>Where <code>other.mproj</code> is:</p> <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003" DefaultTargets="Build"&gt; &lt;Target Name="Build"&gt; &lt;Message Text="kikou" /&gt; &lt;/Target&gt; &lt;/Project&gt; </code></pre> <p>After a while I discovered that modifying the content of <code>other.mproj</code> (for instance, by introducing errors or changing text <code>kikou</code> to something else) would not be taken into account unless unloading/reloading the project in visual studio. </p> <p>Building from the command line with <code>'msbuild myproj.csproj'</code> immediatly detect changes in <code>'other.mproj'</code>. So it all looks like visual studio is working from a cached version of <code>other.mproj</code> file. </p> <p>Why is visual studio caching this other script (which is even not included to the project), and how can I solve this issue ?</p> <p>Update: I also tried this <a href="https://stackoverflow.com/a/2631760/684399">UseHostCompilerIfAvailable</a>, it doesn't work.</p> <hr> <p><em>NB1: I didn't add <code>other.mproj</code> as a project reference in the <code>.csproj</code> because it is not a .NET project at all (it just creates resources files for the <code>.csproj</code> from other inputs before the build)</em></p> <p><em>NB2: I'm using VS2010 (10.0.10219.1SP1Rel + MSBuild 4.0.30319.1)</em></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