简体   繁体   中英

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. So I've tried adding a reference to assembly mscorlib but that just made the errors even more..

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'

Any idea how can I solve this issue? Thanks.

.NetCore Console Application using Visual Studio 2017

MarshalByRefObject is not part of .NetCore so you should not use it.

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/

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM