失败:Microsoft.AspNetCore.Diagnostics.ExceptionHandlerMiddleware [0]

Har*_*ier 8 asp.net-core-mvc asp.net-core

在我的.NET Core应用程序运行时,我注意到以下行:

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.
Run Code Online (Sandbox Code Playgroud)

我只是好奇是什么导致了这个错误,因为我的应用程序仍然正常运行,尽管错误消息.

顺便说一句,我使用的是.NET Core 2.0.0 Preview 1版本.

Tom*_*map 1

Microsoft.AspNetCore.Diagnostics.ExceptionHandlerMiddleware 只是程序中没有其他任何操作时捕获异常的中间件

所以你的“真正”例外是 Method 'Clone' in type 'Microsoft.EntityFrameworkCore.Infrastructure.Internal.SqlServerOptionsExtension' from assembly 'Microsoft.EntityFrameworkCore.SqlServer, ...' does not have an implementation

通过对此异常进行一些谷歌搜索,似乎可以归结为您的 .Net Core 版本与 EF 提供程序的支持

如果您想了解更多信息,您可以: