msbuild: .NET Core: tasks built against v14 contracts don't load on v15

Problem Trying to build a task using the Microsoft.Build.Utilities.Core, 14.0.0.0 contracts that will run on MSBuild 14 or 15. This works on .NET Framework version of MSBuild. The .NET Core version throws when loading the task.

Repro Create a task compiled to netstandard1.3 using https://www.nuget.org/packages/Microsoft.Build.Utilities.Core/14.3.0-prerelease02 Import task via <UsingTask>

Error

Microsoft.AspNetCore.Server.IISIntegration.Tasks.targets(27,9): error MSB4062: The “Microsoft.AspNetCore.Server.IISIntegration.Tasks.TransformWebConfig” task could not be loaded from the assembly build\netstandard1.5\Microsoft.AspNetCore.Server.IISIntegration.Tasks.dll. Could not load file or assembly ‘Microsoft.Build.Utilities.Core, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a’. Could not find or load a specific file. (Exception from HRESULT: 0x80131621) Confirm that the <UsingTask> 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.

Setup Info Using version of MSBuild in .NET Core SDK 1.0.0-preview3-003585

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Comments: 19 (17 by maintainers)

Most upvoted comments

@natemcmaster I tried your repro just now. It installed the latest CLI (1.0.0-preview3-003830) and ran without issues.

The fix for this went in as commit 64fcffdfc80b512122d401061a55cdc9f74bea7c. We’re now waiting for the dotnet CLI to pick up the latest MSBuild binaries.