Closed
Description
In the aspnetcore
repo PR that is attempting to update to the latest SDK build, dotnet/aspnetcore#44925, we're getting the following build error:
D:\a\_work\1\s\.dotnet\sdk\8.0.100-alpha.1.22607.6\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.ApiCompat.ValidatePackage.targets(39,5): error MSB4062: The "Microsoft.DotNet.ApiCompat.Task.ValidatePackageTask" task could not be loaded from the assembly D:\a\_work\1\s\.dotnet\sdk\8.0.100-alpha.1.22607.6\Sdks\Microsoft.NET.Sdk\targets\..\tools\net7.0\Microsoft.DotNet.ApiCompat.Task.dll. Could not load file or assembly 'D:\a\_work\1\s\.dotnet\sdk\8.0.100-alpha.1.22607.6\Sdks\Microsoft.NET.Sdk\tools\net7.0\Microsoft.DotNet.ApiCompat.Task.dll'. The system cannot find the path specified. 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. [D:\a\_work\1\s\src\Framework\App.Ref.Internal\src\Microsoft.AspNetCore.App.Ref.Internal.csproj]
##[error].dotnet\sdk\8.0.100-alpha.1.22607.6\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.ApiCompat.ValidatePackage.targets(39,5): error MSB4062: (NETCORE_ENGINEERING_TELEMETRY=Build) The "Microsoft.DotNet.ApiCompat.Task.ValidatePackageTask" task could not be loaded from the assembly D:\a\_work\1\s\.dotnet\sdk\8.0.100-alpha.1.22607.6\Sdks\Microsoft.NET.Sdk\targets\..\tools\net7.0\Microsoft.DotNet.ApiCompat.Task.dll. Could not load file or assembly 'D:\a\_work\1\s\.dotnet\sdk\8.0.100-alpha.1.22607.6\Sdks\Microsoft.NET.Sdk\tools\net7.0\Microsoft.DotNet.ApiCompat.Task.dll'. The system cannot find the path specified. 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.
Example of a failed build here.
Looks like it's simply because Microsoft.NET.ApiCompat.targets
continues to reference net7.0
but the correct filename now includes net8.0
.
I submitted a possible fix at #29450