title: Solving the Visual Studio 2010 AlwaysCreate rebuild issue
body: <p>I've a C++ project that I'm currently porting from VS2008 to VS2010.  When I build the project, Visual Studio 2010 reports the build as successful but if I then press F5 to start the debugger I'm told that the project is not up to date.  If I ignore this warning, I can continue debugging ok, but if I press ok, the whole project (many hundreds of source files), gets rebuilt from scratch.  The output contains the following;</p>
  <pre><code>1&gt;------ Build started: Project: SCCW-VC2010, Configuration: Debug Win32 ------
  1&gt;Build started 15/11/2010 14:47:40.
  1&gt;InitializeBuildStatus:
  1&gt;  Creating &quot;Debug\SCCW-VC2010.unsuccessfulbuild&quot; because &quot;AlwaysCreate&quot; was specified.
  1&gt;Midl:
  1&gt;  All outputs are up-to-date.
  1&gt;ClCompile:
  1&gt;  tinedit.cpp
  1&gt;  _WIN32_WINNT not defined. Defaulting to _WIN32_WINNT_MAXVER (see WinSDKVer.h)
  1&gt;  Automatically linking with sfl504d.lib
  1&gt;  Automatically linking with ot1104d.lib
  1&gt;c:\program files\rogue wave\stingray studio 10.4\include\toolkit\sectndlg.h(134): warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
  1&gt;          c:\program files\microsoft visual studio 10.0\vc\include\string.h(105) : see declaration of 'strcpy'
  1&gt;  Automatically linking with og1204d.lib
  1&gt;  Automatically linking with RWUXThemeD10.lib
  1&gt;  profile.cpp
  1&gt;  ZOffsetDialog.cpp
  </code></pre>
  <p>Half an hour later, once the build is finished, the debugger starts.  My guess is that the message</p>
  <p><strong>Creating &quot;Debug\SCCW-VC2010.unsuccessfulbuild&quot; because &quot;AlwaysCreate&quot; was specified.</strong></p>
  <p>is part of the problem, but I cant tie this to a project setting.  I've found <a href="https://web.archive.org/web/20120623104219/http://connect.microsoft.com:80/VisualStudio/feedback/details/574245/alwayscreate-needs-documentation-or-vs10-fix" rel="nofollow noreferrer">some help on google</a>, but nothing that has worked thus far.  Anyone else had this problem and know of a fix?</p>
  <p><strong>Edit:</strong>  As per Jalf's suggestion in the comments below, I have created a new projected, imported all my files into that project, and the new project has the same problems.   Specifically, I copied over all the following groups;</p>
  <pre><code>&lt;ClCompile Include=&quot;..\MyDir\MyFile.cpp&quot;/&gt;
  &lt;ClInclude Include=&quot;..\MyDir\MyFile.h&quot; /&gt;
  &lt;None Include=&quot;res\MyFile.ico&quot; /&gt;  (and all similar resources)
  &lt;Library Include=&quot;..\MyDir\MyFile.lib&quot; /&gt;
  </code></pre>
  <p><strong>Edit2:</strong>  After going through all the header includes I eventually found 3 that did not exist.  Removing them and doing a rebuild all on the original project seems to have fixed the problem.  Some of the blog posts that mention this problem refer to it as a bug, and two days of lost time later, I tend to agree.  Thanks for the answers and comments provided.</p>
  <p><strong>Edit3:</strong>  And one day later the problem is back!  Making any edit to any file in the project once again causes a full rebuild.  As per John Dibling's answer, the project does include some static libraries, including Stingray.  I'm ditching VS2010 and moving back to VS2008, as I have deadlines.  For related information, see the following links;</p>
  <p><a href="https://stackoverflow.com/questions/2762930/vs2010-always-thinks-project-is-out-of-date-but-nothing-has-changed">Visual Studio 2010 always thinks project is out of date, but nothing has changed</a></p>
  <p><a href="http://social.msdn.microsoft.com/Forums/en-US/vcgeneral/thread/38c08137-3bb0-4143-b97f-72d077646318" rel="nofollow noreferrer">http://social.msdn.microsoft.com/Forums/en-US/vcgeneral/thread/38c08137-3bb0-4143-b97f-72d077646318</a></p>
  <p><a href="https://docs.microsoft.com/en-us/archive/blogs/vsproject/enable-c-project-system-logging" rel="nofollow noreferrer">Link</a></p>
  <p><strong>Final Edit</strong>  The release of VS2010 SP1 has solved this problem, and builds are now fast and efficient.</p>