C# 从.Net Core 3.0预览版升级到.Net Core 3.0版本后启动时出错

C# 从.Net Core 3.0预览版升级到.Net Core 3.0版本后启动时出错,c#,.net,model-view-controller,.net-core,C#,.net,Model View Controller,.net Core,我在.NETCore3.0预览版中使用相同的代码,没有任何问题。更新到Core 3.0最终版本后,我遇到了以下错误: System.TypeLoadException HResult=0x80131522消息=方法 类型中的“获取信息” “Microsoft.EntityFrameworkCore.SqlServer.Infrastructure.Internal.SqlServerOptionsExtension” 从程序集“Microsoft.EntityFrameworkCore.SqlS

我在.NETCore3.0预览版中使用相同的代码,没有任何问题。更新到Core 3.0最终版本后,我遇到了以下错误:

System.TypeLoadException HResult=0x80131522消息=方法 类型中的“获取信息”
“Microsoft.EntityFrameworkCore.SqlServer.Infrastructure.Internal.SqlServerOptionsExtension”
从程序集“Microsoft.EntityFrameworkCore.SqlServer”, 版本=3.0.0.0,区域性=中性,PublicKeyToken=adb9793829ddae60' 没有实现

出现异常的代码行是:

services.AddDbContext<ApplicationDbContext>(options =>
    options.UseSqlServer(
        Configuration.GetConnectionString("DefaultConnection")));
services.AddDbContext(选项=>
options.UseSqlServer(
GetConnectionString(“DefaultConnection”);

谷歌搜索这个例外没有导致任何结果,知道发生了什么吗?

删除所有以前发布的文件(删除DLL很重要),将所有依赖项升级到.net core 3.0的预览版,然后发布。

代码在core 3.0预览版中工作。可能是因为即使升级了项目,您仍在使用预览软件包吗?尝试在项目中重新安装所有软件包将所有内容更新到3.0版后,我在浏览器中遇到异常:@bobmason,请将此附加信息从注释直接移动到您的问题。右键单击解决方案并选择“Restore Nuget Packages”以重新生成正确的框架版本包。