Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Visual Studio: project is not up to date "because "AlwaysCreate" was specified"?

I've migrated a solution from VS2008 to VS2010 (SP1).
Now one of my project never finds peace in being up-to-date. Every build have the following output:

1>------ Build started: Project: PROJ_NAME, Configuration: Release Win32 ------ 1>Build started 19/05/2011 7:59:27 AM. 1>InitializeBuildStatus: 1>  Creating "Release\PROJ_NAME.unsuccessfulbuild" because "AlwaysCreate" was specified. 1>ClCompile: 1>  All outputs are up-to-date. 1>  All outputs are up-to-date. 1>Lib: 1>  All outputs are up-to-date. 1>  PROJ_NAME.vcxproj -> C:\projFolder.PROJ_NAME.lib 1>FinalizeBuildStatus: 1>  Deleting file "Release\PROJ_NAME.unsuccessfulbuild". 1>  Touching "Release\PROJ_NAME.lastbuildstate". 1> 1>Build succeeded. 1> 1>Time Elapsed 00:00:00.09 ========== Build: 1 succeeded, 0 failed, 5 up-to-date, 0 skipped ========== 

Any ideas?

like image 409
Hertzel Guinness Avatar asked May 19 '11 05:05

Hertzel Guinness


2 Answers

I had a similar problem when one of the include files listed in the project didn't actually exist. I had deleted the file, but forgot to remove it from the project.

The dependency checker then believes the project is not up to date, but the builder finds nothing to build.

like image 72
Bo Persson Avatar answered Sep 28 '22 07:09

Bo Persson


I had two projects that contained the same file. When the second project built, it compiled the file again, changing the 'touch' datetime. That in turn set the 'AlwaysCreate' flag for the first project.

I found this out by turning on 'CPS' in my "C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\devenv.exe.config" file, as in the xml snippet below. With that activated you can use the DebugView tool to get messages from VS2010 that state WHY it is rebuilding your project. Why those messages don't go into the build log is beyond me, but anyway there it is.

Add this:

<system.diagnostics>   <switches>     <add name="CPS" value="4" />   </switches> </system.diagnostics> 

To here:

<?xml version ="1.0"?> <configuration>     <configSections>         <section name="msbuildToolsets" type="Microsoft.Build.BuildEngine.ToolsetConfigurationSection, Microsoft.Build.Engine, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />     </configSections>     <system.diagnostics>       <switches>         <add name="CPS" value="4" />       </switches>     </system.diagnostics>     <startup useLegacyV2RuntimeActivationPolicy="true">         <supportedRuntime version="v4.0.30319" /> 
like image 39
Bzzt Avatar answered Sep 28 '22 06:09

Bzzt