Closed
Description
When merging a new test to the 9.0 branch, we started hitting a type load exception when trying to run the test. Here is the error message:
Aspire.Dashboard.Components.Tests.Controls.ApplicationNameTests.Render_DashboardClientDisabled_Success1ms
Error:
System.TypeLoadException : Could not load type 'Microsoft.JSInterop.IJSUnmarshalledRuntime' from assembly 'Microsoft.JSInterop, Version=9.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60'.
Stack trace:
at Bunit.BunitJSInterop..ctor()
at Bunit.TestContext..ctor() in /_/src/bunit.web/TestContext.cs:line 14
at Aspire.Dashboard.Components.Tests.Controls.ApplicationNameTests..ctor()
at System.RuntimeType.CreateInstanceDefaultCtor(Boolean publicOnly, Boolean wrapExceptions)
The issue is that the test class uses BUnit TestContext, which relies on type IJSUnmurshalledRuntime which was removed from 9.0 in PR dotnet/aspnetcore#52732. This issue is to track the work to re-enable the test in 9.0 branch, whether it is by not using BUnit TestContext, or by having BUnit not depend on that type any longer.