gpt4 book ai didi

c# - .Net Framework dll 不适用于 .Net Standard 项目

转载 作者:行者123 更新时间:2023-11-30 13:21:33 26 4
gpt4 key购买 nike

我已将 .Net 框架 ddl 引用到 .Net 标准 2.0。它会向我显示以下错误。

System.Reflection.ReflectionTypeLoadException: 'Unable to load one or more of the requested types.
The given assembly name or codebase, '\bin\Debug\netcoreapp2.1\FirstDataBank.DrugServer.API.dll', was invalid.
The given assembly name or codebase, '\bin\Debug\netcoreapp2.1\FirstDataBank.DrugServer.API.dll', was invalid.
The given assembly name or codebase, '\bin\Debug\netcoreapp2.1\FirstDataBank.DrugServer.API.dll', was invalid.
The given assembly name or codebase, '\bin\Debug\netcoreapp2.1\FirstDataBank.DrugServer.API.dll', was invalid.'

相同的 ddl 在 .Net 框架项目上运行良好但对于 .Net 标准它将显示错误。

最佳答案

这根本不受支持。

您可以从 .NET Framework 项目中引用一些(但不是全部).NET 标准库,但不支持其他方式。

.NET Standard 旨在支持不同平台之间的代码共享,但 .NET Framework 仅支持 Windows。

为了让您开始讨论这个主题,这里有一篇很好的帖子,对它进行了非常简短的解释: Difference between Standard, Framework and Core

关于c# - .Net Framework dll 不适用于 .Net Standard 项目,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57688855/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com