Skip to content

KnownFrameworkReference workarounds not working for certain AspNetCore-Tooling tests #18722

Closed
@wtgodbe

Description

@wtgodbe

We attempt to update our FrameworkReference to Microsoft.NetCore.App so that we reference the shared framework version from versions.props, rather than the version in the SDK:

https://github.com/dotnet/aspnetcore-tooling/blob/9a05bd16c6f075f90ae2fe7ae0b9ab03199eb9b6/Directory.Build.targets#L18-L28

However, for certain AspNetCore-Tooling tests, this isn't happening for some reason, which is causing the tests to fail any time dotnet/runtime changes API surface area. This has happened a couple times, most recently in dotnet/razor#1551, and the solution is typically to wait until we can get a new SDK. We should figure out why the workaround doesn't apply to these tests, and fix it:

MSB4018: The "RazorTagHelper" task failed unexpectedly. 
[F:\workspace\_work\1\s\artifacts\tmp\Release\Razor\txwy4p0j.jou\ClassLibrary\ClassLibrary.csproj]\r\nF:\workspace\_work\1\s\src\Razor\src\Microsoft.NET.Sdk.Razor\build\netstandard2.0\Microsoft.NET.Sdk.Razor.CodeGeneration.targets(99,5): error MSB4018: System.TypeLoadException: Could not load type 'System.Diagnostics.Debugger' from assembly 'System.Runtime, Version=5.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. 
[F:\workspace\_work\1\s\artifacts\tmp\Release\Razor\txwy4p0j.jou\ClassLibrary\ClassLibrary.csproj]\r\nF:\workspace\_work\1\s\src\Razor\src\Microsoft.NET.Sdk.Razor\build\netstandard2.0\Microsoft.NET.Sdk.Razor.CodeGeneration.targets(99,5): error MSB4018: at Microsoft.AspNetCore.Razor.Tasks.DotNetToolTask.Execute() 
[F:\workspace\_work\1\s\artifacts\tmp\Release\Razor\txwy4p0j.jou\ClassLibrary\ClassLibrary.csproj]\r\nF:\workspace\_work\1\s\src\Razor\src\Microsoft.NET.Sdk.Razor\build\netstandard2.0\Microsoft.NET.Sdk.Razor.CodeGeneration.targets(99,5): error MSB4018: at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute() 
[F:\workspace\_work\1\s\artifacts\tmp\Release\Razor\txwy4p0j.jou\ClassLibrary\ClassLibrary.csproj]\r\nF:\workspace\_work\1\s\src\Razor\src\Microsoft.NET.Sdk.Razor\build\netstandard2.0\Microsoft.NET.Sdk.Razor.CodeGeneration.targets(99,5): error MSB4018: at Microsoft.Build.BackEnd.TaskBuilder.ExecuteInstantiatedTask(ITaskExecutionHost taskExecutionHost, TaskLoggingContext taskLoggingContext, TaskHost taskHost, ItemBucket bucket, TaskExecutionMode howToExecuteTask) 
[F:\workspace\_work\1\s\artifacts\tmp\Release\Razor\txwy4p0j.jou\ClassLibrary\ClassLib

https://github.com/dotnet/aspnetcore-tooling/tree/master/src/Razor/test/testapps/ClassLibrary

This could be similar to our template tests - since these are executing from the artifacts dir, maybe they're not importing our directory.build.targets file. Or, maybe it's related to these tests using the Razor SDK.

CC @dotnet/aspnet-build @Tratcher

Metadata

Metadata

Assignees

Labels

DoneThis issue has been fixedarea-infrastructureIncludes: MSBuild projects/targets, build scripts, CI, Installers and shared framework

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions