当我的.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.
我只是好奇导致此错误的原因是因为我的应用程序仍然正常运行,尽管出现错误消息。
顺便说一句,我使用的是.NET Core 2.0.0 Preview 1版本。
答案 0 :(得分:0)
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 Provider
如果您想了解更多信息,可以: