Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

fail: Microsoft.AspNetCore.Diagnostics.ExceptionHandlerMiddleware[0]

While my .NET Core application is running, I noticed the following line:

fail: Microsoft.AspNetCore.Diagnostics.ExceptionHandlerMiddleware[0]
      An unhandled exception has occurred: Method 'Clone' in type 'Microsoft.EntityFrameworkCore.Infrastructure.Internal.SqlServerOptionsExtension' from assembly 'Microsoft.EntityFrameworkCore.SqlServer, Version=1.1.2.0, Culture=neutral, PublicKeyToken=adb9793829ddae60' does not have an implementation. System.TypeLoadException: Method 'Clone' in type 'Microsoft.EntityFrameworkCore.Infrastructure.Internal.SqlServerOptionsExtension' from assembly 'Microsoft.EntityFrameworkCore.SqlServer, Version=1.1.2.0, Culture=neutral, PublicKeyToken=adb9793829ddae60' does not have an implementation.

I'm just curious what's causing this error because my apps is still running fine despite the error message.

By the way, I'm using .NET Core 2.0.0 Preview 1 version.

like image 432
Harold Javier Avatar asked Jul 03 '17 08:07

Harold Javier


1 Answers

Microsoft.AspNetCore.Diagnostics.ExceptionHandlerMiddleware is just the middleware catching exceptions when nothing else in your program did

So your "real" exception is Method 'Clone' in type 'Microsoft.EntityFrameworkCore.Infrastructure.Internal.SqlServerOptionsExtension' from assembly 'Microsoft.EntityFrameworkCore.SqlServer, ...' does not have an implementation

By doing some googling with this exception, it seems to get down to support of your .Net Core version vs your EF Provider

If you want more information, you can:

  • https://docs.microsoft.com/en-us/aspnet/core/fundamentals/error-handling?view=aspnetcore-2.1#the-developer-exception-page Enable Developer Exception pages
  • Log more information from EF (https://docs.microsoft.com/en-us/aspnet/core/fundamentals/logging/?view=aspnetcore-2.1#add-providers => enable in trace mode will get you more information)
like image 197
Tomap Avatar answered Sep 22 '22 04:09

Tomap