【问题标题】:VS dll reference error - Instance object was created as immutableVS dll 引用错误 - 实例对象被创建为不可变对象
【发布时间】:2022-07-07 21:31:26
【问题描述】:

如果您尝试将 NetStandard 库 dll 添加到 .net 核心应用程序,Visual Studio 会抛出错误:

instance object was created as immutable

并且拒绝添加引用。

【问题讨论】:

    标签: c# visual-studio .net-core .net-standard .net-standard-2.0


    【解决方案1】:

    我想我会分享这个,因为在搜索中没有任何结果。 您需要先添加对 NetStandard.Library NuGet 包的引用,然后才能添加 .net 标准库。

    https://www.nuget.org/packages/NETStandard.Library

    然后添加对 DLL 的引用。

    附带说明一下,将项目引用添加到 netstandard 2.0 项目,但添加到其输出 dll 时,我从来没有遇到任何问题 - 我做到了。

    【讨论】:

      猜你喜欢
      • 2018-01-16
      • 1970-01-01
      • 2012-11-08
      • 1970-01-01
      • 2011-07-09
      • 2012-08-31
      • 2011-11-21
      • 2012-10-01
      • 1970-01-01
      相关资源
      最近更新 更多