vs dll参考错误 - 实例对象是不变的

发布于 2025-02-13 15:25:43 字数 131 浏览 0 评论 0原文

如果您尝试将NetStandard Library DLL添加到.NET Core Application Visual Studio将引发错误:

实例对象作为不可变的

,并拒绝添加参考。

If you try to add a NetStandard library dll to a .net core application Visual Studio throws the error:

instance object was created as immutable

And refuses to add the reference.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

七月上 2025-02-20 15:25:43

我以为我会分享这一点,因为搜索并没有太多出现。
您需要在添加.NETSTANDARD库之前添加netStandard.library Nuget软件包的引用。

https://www.nuget.org/packages/netnetantard.library.library dll。

附带说明,我从来没有遇到任何问题,将项目引用添加到NetStandard 2.0项目中,但是我的输出DLL-我做到了。

I thought I would share this as nothing much turns up in a search.
You need to add a reference to the NetStandard.Library NuGet Package, before you can add a .netstandard library.

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

Then add references to the DLL.

As a side note, I never had any issues adding a project reference to a netstandard 2.0 project, but to its output dll - I did.

汹涌人海 2025-02-20 15:25:43

在尝试添加对Twincat.ads库的引用时,我遇到了这个问题。事实证明我的问题与您的相反。我已经使用Nuget添加了包装。 Nuget无法正确安装软件包,但阻止我分别添加对依赖项的引用。在将库添加到参考文献之前,我必须从Nuget中删除包裹。

I had this issue when trying to add a reference to the TwinCat.ADS library. My issue turned out to be the opposite of yours. I had added the package using NuGet. NuGet didn't install the package correctly but was preventing me from adding the reference to the dependencies separately. I had to remove the package from NuGet before I could add the library to the references.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文