我有一个 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
发布评论