错误:无法加载文件或程序集 netstandard,版本 = 2.1.0.0

编程入门 行业动态 更新时间:2024-10-18 06:04:44
本文介绍了错误:无法加载文件或程序集 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 为目标的项目并尝试添加以 标准 2.1 为目标的库,那么您将收到相同的错误,因为 .Net Core 2.2 与 标准 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 standard 2.1 then you will get the same error because .Net Core 2.2 is compatible with 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

本文发布于:2023-11-07 15:17:44,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1566800.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:加载   错误   版本   文件   程序

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!