title: Microsoft.Build.CPPTasks.Common cannot find Microsoft.Build.Tasks.Core
body: <p>I just upgraded a project from Visual C++ 2012 to Visual C++ 2017 and I'm getting build failures from MSBuild:</p>
  
  <blockquote>
    <p>C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\Common7\IDE\VC\VCTargets\Microsoft.Cpp.Current.targets(64,5): error MSB4062: The "SetEnv" task could not be loaded from the assembly C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\Common7\IDE\VC\VCTargets\Microsoft.Build.CppTasks.Common.dll. Could not load file or assembly 'Microsoft.Build.Utilities.Core, Version=15.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified. Confirm that the  declaration is correct, that the assembly and all its dependencies are available, and that the task contains a public class that implements Microsoft.Build.Framework.ITask. [C:\src\my-project.vcxproj]</p>
  </blockquote>
  
  <p>The Fusion log shows bad things:</p>
  
  <pre><code>*** Assembly Binder Log Entry  (2/12/2018 @ 1:44:29 PM) ***
  
  The operation failed.
  Bind result: hr = 0x80070002. The system cannot find the file specified.
  
  Assembly manager loaded from:  C:\Windows\Microsoft.NET\Framework\v4.0.30319\clr.dll
  Running under executable  C:\windows\Microsoft.NET\Framework\v4.0.30319\msbuild.exe
  --- A detailed error log follows. 
  
  === Pre-bind state information ===
  LOG: DisplayName = Microsoft.Build.Utilities.Core, Version=15.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
   (Fully-specified)
  LOG: Appbase = file:///C:/windows/Microsoft.NET/Framework/v4.0.30319/
  LOG: Initial PrivatePath = NULL
  LOG: Dynamic Base = NULL
  LOG: Cache Base = NULL
  LOG: AppName = msbuild.exe
  Calling assembly : Microsoft.Build.CPPTasks.Common, Version=15.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a.
  ===
  LOG: This bind starts in LoadFrom load context.
  WRN: Native image will not be probed in LoadFrom context. Native image will only be probed in default load context, like with Assembly.Load().
  LOG: Using application configuration file: C:\windows\Microsoft.NET\Framework\v4.0.30319\msbuild.exe.Config
  LOG: Using host configuration file: 
  LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework\v4.0.30319\config\machine.config.
  LOG: Post-policy reference: Microsoft.Build.Utilities.Core, Version=15.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
  LOG: GAC Lookup was unsuccessful.
  LOG: Attempting download of new URL file:///C:/windows/Microsoft.NET/Framework/v4.0.30319/Microsoft.Build.Utilities.Core.DLL.
  LOG: Attempting download of new URL file:///C:/windows/Microsoft.NET/Framework/v4.0.30319/Microsoft.Build.Utilities.Core/Microsoft.Build.Utilities.Core.DLL.
  LOG: Attempting download of new URL file:///C:/windows/Microsoft.NET/Framework/v4.0.30319/Microsoft.Build.Utilities.Core.EXE.
  LOG: Attempting download of new URL file:///C:/windows/Microsoft.NET/Framework/v4.0.30319/Microsoft.Build.Utilities.Core/Microsoft.Build.Utilities.Core.EXE.
  LOG: Attempting download of new URL file:///C:/Program Files (x86)/Microsoft Visual Studio/2017/Professional/Common7/IDE/VC/VCTargets/Microsoft.Build.Utilities.Core.DLL.
  LOG: Attempting download of new URL file:///C:/Program Files (x86)/Microsoft Visual Studio/2017/Professional/Common7/IDE/VC/VCTargets/Microsoft.Build.Utilities.Core/Microsoft.Build.Utilities.Core.DLL.
  LOG: Attempting download of new URL file:///C:/Program Files (x86)/Microsoft Visual Studio/2017/Professional/Common7/IDE/VC/VCTargets/Microsoft.Build.Utilities.Core.EXE.
  LOG: Attempting download of new URL file:///C:/Program Files (x86)/Microsoft Visual Studio/2017/Professional/Common7/IDE/VC/VCTargets/Microsoft.Build.Utilities.Core/Microsoft.Build.Utilities.Core.EXE.
  LOG: All probing URLs attempted and failed.
  </code></pre>
  
  <p>Just posted this at <a href="https://developercommunity.visualstudio.com/content/problem/197469/microsoftbuildcpptaskscommon-cannot-find-microsoft.html" rel="nofollow noreferrer">Visual Studio Community</a> but in <a href="https://developercommunity.visualstudio.com/content/problem/24545/microsoftbuildcpptaskscommon-references-incorrect.html" rel="nofollow noreferrer">another almost identical bug report</a> they closed it as "Not a Bug" for reasons I cannot comprehend. I'm hoping StackOverflow will be more helpful. :)</p>