简体   繁体   English

“MarshalByRefObject”类型是在未引用的程序集中定义的。 您必须添加对程序集 'mscorlib, Version=4.0.0.0 的引用

[英]The type 'MarshalByRefObject' is defined in an assembly that is not referenced. You must add a reference to assembly 'mscorlib, Version=4.0.0.0

I'm trying to make a C# Console Application using .NetCore on "Visual Studio 2017" for the sake of running it on CentOS 7 , what seems to be the issue is that apparently the .NetCore doesn't have some of the Classes that's inside the .Net Framework, or that's what I think the problem is.我正在尝试在“Visual Studio 2017”上使用.NetCore制作一个C# 控制台应用程序,以便在CentOS 7上运行它,似乎问题在于 .NetCore 显然没有一些类在 .Net Framework 内部,或者这就是我认为的问题所在。 So I've tried adding a reference to assembly mscorlib but that just made the errors even more..所以我尝试添加对程序集mscorlib的引用,但这只会使错误更加严重..

Error CS0433 The type 'StringBuilder' exists in both 'mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' and 'System.Runtime, Version=4.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'错误 CS0433 类型 'StringBuilder' 存在于 'mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' 和 'System.Runtime, Version=4.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7a3a1d'

Any idea how can I solve this issue?知道如何解决这个问题吗? Thanks.谢谢。

.NetCore Console Application using Visual Studio 2017 .NetCore 控制台应用程序使用 Visual Studio 2017

MarshalByRefObject is not part of .NetCore so you should not use it. MarshalByRefObject 不是 .NetCore 的一部分,所以你不应该使用它。

Scroll to comments and you will find info and link about replacement.滚动到评论,您会找到有关更换的信息和链接。 https://blogs.msdn.microsoft.com/dotnet/2016/05/27/making-it-easier-to-port-to-net-core/ https://blogs.msdn.microsoft.com/dotnet/2016/05/27/making-it-easier-to-port-to-net-core/

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 .Net Framework 您必须添加对程序集 mscorlib 的引用,版本 = 4.0.0.0 - .Net Framework You must add a reference to assembly mscorlib, Version=4.0.0.0 为什么我得到:“IThirdParty”类型是在未引用的程序集中定义的。 您必须添加对程序集“ThirdPartyAssembly”的引用吗? - Why am I getting: The type 'IThirdParty' is defined in an assembly that is not referenced. You must add a reference to assembly 'ThirdPartyAssembly'? “组件”类型是在未引用的程序集中定义的。 您必须添加对程序集“System.ComponentModel.Primitives”的引用 - The type 'Component' is defined in an assembly that is not referenced. You must add a reference to assembly 'System.ComponentModel.Primitives' “System.Object”类型在未引用的程序集中定义。 您必须添加对程序集 .netstandard 的引用 - The type 'System.Object' is defined in an assembly that is not referenced. You must add a reference to assembly 'netstandard 类型“ System.Data.Common.DbTransaction”在未引用的程序集中定义。 您必须添加对程序集的引用 - The type 'System.Data.Common.DbTransaction' is defined in an assembly that is not referenced. You must add a reference to assembly NSubstitute -3.x &#39;ValueType&#39; 在未引用的程序集中定义。 您必须添加对程序集“netstandard”的引用, - NSubstitute -3.x 'ValueType' is defined in an assembly that is not referenced. You must add a reference to assembly 'netstandard, System.IObserver&#39;1 <T0> 在未引用的程序集中定义。 您必须添加对程序集的引用 - System.IObserver'1<T0> is defined in an assembly that is not referenced. You must add a reference to assembly 类型“ DbConnection”在未引用的程序集中定义。 我无法添加参考? - The type 'DbConnection' is defined in an assembly that is not referenced. I cannot add the reference? 您必须添加对程序集 mscorlib 的引用,版本=4.0.0 - You must add a reference to assembly mscorlib, version=4.0.0 类型“ IReportServerCredentials”在未引用的程序集中定义。 - type 'IReportServerCredentials' is defined in an assembly that is not referenced.
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM