Errors 'Object' is defined in assembly not referenced mscorlib

SpencerHSpencerH Member ✭✭

I am using Visual Studio on a Mac. I updated VS and then I was having some issues with not being able to restore NuGet packages so I installed Mono, then cleared the local nuget. After that I was able to restore NuGet packages.

The type 'Object' is defined in an assembly that is not referenced. You must add a reference to assembly 'mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.

I have roughly around 100 of these errors when I try to build saying that I need assembly 'mscorlib'. I found a stackexchange which add a compatibility pack for portability. When I added that I had over 800 errors so i took that away and did the restore as described above. Now how do I clear this annoying mscorelib error?

Also, I had changed the target version of the main app from 2.0 to 1.4 trying to see if I could fix anything that way. I have since moved it back.

Answers

  • LandLuLandLu Member, Xamarin Team Xamurai

    Can you reproduce this on a new blank project? I'm afraid you have messed up your environment. If the new project also throws this issue, the Visual Studio 2017 maybe needs to be reinstalled. If you do not want to reinstall it, try to remove all the references to the library(.Net standard library, forms nuget) then add them again.

Sign In or Register to comment.