Quantcast
Channel: Active questions tagged blazor - Stack Overflow
Viewing all articles
Browse latest Browse all 4839

Why does DisplayClass11 generate in .NET Core hot reload?

$
0
0

How does hot reload implement in .NET Core? Does it modify the project's assembly ?

I open my Blazor project with dotnet watch, but got the following error:

fail: Microsoft.Extensions.Hosting.Internal.Host[9]      BackgroundService failed      System.TypeLoadException: Could not load type 'Invalid_Token.0x02000118' from assembly 'MyBlazorWebApp, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'.         at BooksService.<>c__DisplayClass11_0.<WatchChangesAsync>b__1         at MongoDB.Driver.IAsyncCursorExtensions.ForEachAsync[TDocument](IAsyncCursor`1 source, Func`3 processor, CancellationToken cancellationToken)         at BooksService.WatchChangesAsync(CancellationToken cancellationToken)         at BookBackgroundService.ExecuteAsync(CancellationToken stoppingToken)         at Microsoft.Extensions.Hosting.Internal.Host.TryExecuteBackgroundServiceAsync(BackgroundService backgroundService)crit: Microsoft.Extensions.Hosting.Internal.Host[10]      The HostOptions.BackgroundServiceExceptionBehavior is configured to StopHost. A BackgroundService has thrown an unhandled exception, and the IHost instance is stopping. To avoid this behavior, configure this to Ignore; however the BackgroundService will not be restarted.      System.TypeLoadException: Could not load type 'Invalid_Token.0x02000118' from assembly 'MyBlazorWebApp, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'.         at BooksService.<>c__DisplayClass11_0.<WatchChangesAsync>b__1         at MongoDB.Driver.IAsyncCursorExtensions.ForEachAsync[TDocument](IAsyncCursor`1 source, Func`3 processor, CancellationToken cancellationToken)         at BooksService.WatchChangesAsync(CancellationToken cancellationToken)         at BookBackgroundService.ExecuteAsync(CancellationToken stoppingToken)         at Microsoft.Extensions.Hosting.Internal.Host.TryExecuteBackgroundServiceAsync(BackgroundService backgroundService)info: Microsoft.Hosting.Lifetime[0]

I have no idea why this error contains DisplayClass11_0 which I don't find anywhere in the project.

Can I think it was added in through hot reload mode?


Viewing all articles
Browse latest Browse all 4839

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>