错误:无法加载文件或程序集 netstandard,版本 = 2.1.0.0 [英] Error: Cannot load file or assembly netstandard, Version=2.1.0.0

查看:26
本文介绍了错误:无法加载文件或程序集 netstandard,版本 = 2.1.0.0的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个 AzureFunctions 项目,我需要升级到 .NET 标准 2.1(从 2.0)解决方案中的所有其他项目都可以正确加载和编译,但是这个 AzureFunctions 项目抛出了这个错误:

I have a AzureFunctions project that I needed to upgrade to .NET standard 2.1 (from 2.0) All of my other projects in the solution load and compile correctly but this AzureFunctions project is throwing this error:

错误 System.IO.FileNotFoundException:无法加载文件或程序集netstandard,版本=2.1.0.0,Culture=neutral,PublicKeyToken=cc7b13ffcd2ddd51".该系统找不到指定的文件.文件名:'netstandard,Version=2.1.0.0,Culture=neutral,PublicKeyToken=cc7b13ffcd2ddd51'

Error System.IO.FileNotFoundException: Could not load file or assembly 'netstandard, Version=2.1.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'. The system cannot find the file specified. File name: 'netstandard, Version=2.1.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'

我已验证所有 nuget 包都已更新,还有什么可能?

I've verified all the nuget packages are updated, what else could it be?

谢谢!

推荐答案

有时您会收到此错误,因为您引用了针对不兼容的 .Net 标准的库/nuget 包.示例:如果您创建以 .Net Core 2.2 为目标的项目并尝试添加以 .net 标准 2.1 为目标的库,那么您将收到相同的错误,因为 .Net Core 2.2 与 .net 标准 2.0 或更低版本兼容,因此您可以将目标包/库添加到 .Net Standard 2.0 或更低版本.详情请查看链接:

Some times you receive this error because you have referenced a library/nuget package that target the incompatible .Net standard. example: If you create project that target to .Net Core 2.2 and you try to add the library which target .net standard 2.1 then you will get the same error because .Net Core 2.2 is compatible with .net standard 2.0 or lower so you can add package/library that target to .Net Standard 2.0 or lower version. Please see the links for more details :

.Net Core 和 .Net Standard

.Net 标准兼容性表

这篇关于错误:无法加载文件或程序集 netstandard,版本 = 2.1.0.0的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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