You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Since a forced upgrade to .NET 5 (for Blazor .NET 6), DbContext Core requires DI Logging, thus unit tests requiring DbContext fail in the VS Test Explorer.
As soon as asplib.blazor gets referenced in test.core, we get a MissingMethodException at LoggerFactory.Create(). If the reference is only removed, the DbTest tests using DBContext pass. Problem is the reference to Microsoft.AspNetCore.Components.Web.
The text was updated successfully, but these errors were encountered:
DbContext Core requires DI Logging, but only referencing
Microsoft.AspNetCore.Components.Web breaks the LoggerFactory
on runtime with MissingMethodException.
SetUpDbContext() in tests now set up a test-specific ServiceProvider
with the NullLoggerFactory which gets applied by
optionsBuilder.UseInternalServiceProvider(ServiceProvider).
Update EF Core to 5.0.17
Since a forced upgrade to .NET 5 (for Blazor .NET 6), DbContext Core requires DI Logging, thus unit tests requiring DbContext fail in the VS Test Explorer.
As soon as asplib.blazor gets referenced in test.core, we get a MissingMethodException at LoggerFactory.Create(). If the reference is only removed, the DbTest tests using DBContext pass. Problem is the reference to Microsoft.AspNetCore.Components.Web.
The text was updated successfully, but these errors were encountered: