“无法加载类型"从 .NET Core 3.0 预览版更新到发布后的异常 [英] "Could not load type" exception after updating from .NET Core 3.0 preview to release

查看:30
本文介绍了“无法加载类型"从 .NET Core 3.0 预览版更新到发布后的异常的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

更新到 .NET Core 3.0 版本后,我在浏览器中收到此错误:

I got this error in the browser after updating to .NET Core 3.0 release:

TypeLoadException: 无法加载类型来自程序集的System.Diagnostics.CodeAnalysis.MaybeNullAttribute"'netstandard,版本=2.1.0.0,文化=中性,PublicKeyToken=cc7b13ffcd2ddd51

TypeLoadException: Could not load type 'System.Diagnostics.CodeAnalysis.MaybeNullAttribute' from assembly 'netstandard, Version=2.1.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51

我已将所有内容更新到最新版本 3.0.这是一个错误吗?我该怎么办?

I've updated everything to the latest version, 3.0. Is it a bug? What should I do?

推荐答案

使用 .NET Core 预览版 SDK 时出现此错误.基于 这个 GitHub 问题R00iBaard 发表评论 在 2019 年 9 月 26 日使用此解决方案:

This error occurs when using the preview SDK of .NET Core. Based on this GitHub issue, R00iBaard left a comment with this solution on Sep 26, 2019:

大家好,我通过以下方式解决了我的问题:

Hey all, I resolved mine the following way:

  • 确保已卸载所有 .NET Core 运行时和 SDK.运行 dotnet --info 来查看.如果安装 3.0.100 没有删除预览,请转到这些目录并手动删除它们.重新安装(修改).NET Core 3.0.100 安装再次安全.

  • Make sure all .NET Core runtimes and SDKs are uninstalled. Run dotnet --info to see. If installing 3.0.100 didn't remove the previews, go to those dirs and manually remove them. Re install (modify) the .NET Core 3.0.100 installation to be safe again.

确保您已安装 VS 2019 16.3.1

Make sure you have installed VS 2019 16.3.1

错误应该消失.
[原文]

Error should disappear.
[sic]

这篇关于“无法加载类型"从 .NET Core 3.0 预览版更新到发布后的异常的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆