Visual Studio 2012 - MSBuild incremental build not detecting changes -


i have customised msbuild project default target new target named 'buildwithexternalreference'. new target calls 2 other targets; first custom target called 'buildexternalreference' builds dll using external tool. dll built reference main project, built using normal 'build' target. have setup inputs , outputs attributes 'buildexternalreference' target inputs reference source files , outputs reference resulting dll.

in both visual studio 2012 , visual studio 2010 build works correctly first time invoked. however, on subsequent builds if change external source files (referenced 'buildexternalreference' target inputs attribute) visual studio 2012 reports 'build: 0 succeeded, 0 failed, 1 up-to-date, 0 skipped'. visual studio 2010 continues work perfectly. in addition, building command line msbuild.exe works perfectly.

i'm aware build system in visual studio 2012 has changed, can't find information changes way incremental builds performed.

has changed in visual studio 2012 cause incremental builds change?

here's cut down version of csproj file i'm using:

<?xml version="1.0" encoding="utf-8"?> <project toolsversion="4.0" defaulttargets="buildwithexternaltool" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">   <itemgroup>     <externalsourcefiles include="..\externalsourcefiles\\*\*.cs" />     <externaldll include="..\externalsource\external.dll" />   </itemgroup>   <import project="$(msbuildbinpath)\microsoft.csharp.targets" />   <target name="buildexternaltool" inputs="@(externalsourcefiles);" outputs="@(externaldll)">     <exec command="c:\external\path\to\tool.exe" />   </target>   <target name="buildwithexternaltool">     <calltarget targets="buildexternaltool" />     <calltarget targets="build" />   </target> </project> 

update 1st of november 2012

here's complete self contained example reproduces issue:

https://skydrive.live.com/redir?resid=ea1dd6aca92f9eff!155&authkey=!anhuqf_rrcgxple

this solution 1 project. msbuildissueexample\msbuildissueexample.csproj file has been customised there custom default target. default target calls custom target (called 'externaltool') , default build target.

the custom externaltool target writes out messages make sure it's working, , copies contents of msbuildissueexample\externaltool\input.txt file on msbuildissueexample\externaltool\output.txt file.

the input.txt file input of externaltool target, , output.txt output.

to recreate issue follow these steps:

1) open solution in designated version of visual studio

2) build solution once make sure outputs date respect inputs

3) modify msbuildissueexample\externaltool\input.txt content not match output.txt

4) build again

when go through process in visual studio 2010 externaltool target invoked again, , input.txt file copied on output.txt.

when go through process in visual studio 2012 externaltool target not invoked, though inputs newer outputs, , result contents of input.txt not written output.txt.

however, if rebuild (rather build) both versions of visual studio work expected.

this feedback microsoft answers question:

"this due change in vs 2012 c#/vb projects "fast up-to-date check" allows them skip build, rather forcing build time. 1 downside, however, fast up-to-date check not take account custom targets, why incremental change not detected. if wish disable "fast up-to-date check" please set "disablefastuptodatecheck" true either msbuild property in project file or environment variable in environment launch vs from."

http://connect.microsoft.com/visualstudio/feedback/details/770784/visual-studio-2012-msbuild-incremental-build-not-detecting-changes#details

so breaking change in visual studio 2012 unfortunately not seem documented well.


Comments

Popular posts from this blog

SPSS keyboard combination alters encoding -

Add new record to the table by click on the button in Microsoft Access -

javascript - jQuery .height() return 0 when visible but non-0 when hidden -