vs dll参考错误 - 实例对象是不变的
如果您尝试将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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我以为我会分享这一点,因为搜索并没有太多出现。
您需要在添加.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.
在尝试添加对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.