title: MSBuild error MSB4018 in VS2015: The "Link" task failed unexpectedly
body: <p>After upgrading a solution with 25 projects from VS2012 Update 4 to VS2015 RTM (14.0.23107.0), I get the following error while building one of the projects:</p>
  
  <p><strong>(...) MSB4018: 'The "Link" task failed unexpectedly. (...) System.NullReferenceException: Object reference not set to an instance of an object.' (...)</strong></p>
  
  <p><em>Here the full output:</em></p>
  
  <pre><code>1&gt;------ Build started: Project: Buttons, Configuration: Release Win32 ------
  1&gt;C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.CppCommon.targets(643,5): error MSB4018: The "Link" task failed unexpectedly.
  1&gt;C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.CppCommon.targets(643,5): error MSB4018: System.NullReferenceException: Object reference not set to an instance of an object.
  1&gt;C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.CppCommon.targets(643,5): error MSB4018:    at Microsoft.Build.CPPTasks.Link.ForcedRebuildRequired()
  1&gt;C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.CppCommon.targets(643,5): error MSB4018:    at Microsoft.Build.CPPTasks.TrackedVCToolTask.ComputeOutOfDateSources()
  1&gt;C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.CppCommon.targets(643,5): error MSB4018:    at Microsoft.Build.CPPTasks.TrackedVCToolTask.SkipTaskExecution()
  1&gt;C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.CppCommon.targets(643,5): error MSB4018:    at Microsoft.Build.Utilities.ToolTask.Execute()
  1&gt;C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.CppCommon.targets(643,5): error MSB4018:    at Microsoft.Build.CPPTasks.TrackedVCToolTask.Execute()
  1&gt;C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.CppCommon.targets(643,5): error MSB4018:    at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()
  1&gt;C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.CppCommon.targets(643,5): error MSB4018:    at Microsoft.Build.BackEnd.TaskBuilder.&lt;ExecuteInstantiatedTask&gt;d__1.MoveNext()
  ========== Build: 0 succeeded, 1 failed, 24 up-to-date, 0 skipped ==========
  </code></pre>
  
  <p>I've tried already several suggested solutions related to MSB4018 without any success. The error <em>'The "Link" task failed unexpectedly'</em> wasn't even indexed by Google yet. I guess this issue is somehow related to the type of the project because it's the only project in the solution that's used as a resource DLL (i.e. with no entry point, etc.). The only changes that have been made to the project file by VS2015 are "<em>ToolsVersion: 4.0 => 14.0</em>" and "<em>PlatformToolset: v110_xp => v140_xp</em>".</p>
  
  <p>Does anyone has a solution for this?</p>