Upgrade to Visual Studio for Mac - now 53K errors!

BrianKnoxBrianKnox USMember ✭✭

The compiler no longer even recognizes int32, or System.Object.

I get errors like this throughout my entire codebase:

"Predefined type 'System.Object' is not defined or imported."
"Predefined type 'System.Int32' is not defined or imported."

I first upgraded to latest Xamarin Studio, and it gave me a bunch of compiler errors, which were mysterious (such as no longer recognizing System.Xml.Linq")... and so I decided to upgrade to using Visual Studio for Mac instead -- and now I have 53,000 compiler errors!

I was seeing in some threads where they mention this might be somehow related to the "portable-pdb" etc, but those are old threads. And besides, I have no idea how to change that anyways.

We have a large project with 300,000 lines of code, and ~2000 .cs files. I really do not want to reconstruct all of these projects from scratch again.

Something very dumb has happened to my project in this upgrade. Not sure why it doesn't even know what an Int32 is now!

Posts

  • NashZhouNashZhou USMember ✭✭✭

    I'm assuming the good old clean and rebuild doesn't work.

    I found this on the internet so I'm wondering if you tried changing your TargetFrameworkVersion in your csproj file.

  • BrianKnoxBrianKnox USMember ✭✭

    NahZhou, thank you for taking the time to answer me on this. I appreciate your time and effort!


    I didn't change a thing in my projects or source code; I simply updated to the latest Xamarin Studio, and then Xamarin Studio gave me 1440 errors, mostly to do with XML and LINQ namespaces.

    And so then I downloaded the recommended Visual Studio for MAC 2017 community edition, and compiled, and got 54,000 errors. I upgraded to the latest

    My project file framework specifiers look like this:

    Xamarin.iOS
    v1.0

  • JimBennettJimBennett GBXamarin Team, Insider, University, Developer Group Leader ✭✭✭✭
    edited June 2017

    Have you tried a full rebuild? Ideally install Redths add-ins from 'Visual Studio->Extensions' and do an 'Obliterate output paths' at the solution level, then build all.

    VS for Mac uses different build stuff to XS, so you do need a clean build after upgrading.

  • BrianKnoxBrianKnox USMember ✭✭

    I went back to Xamarin Studio, and it's showing me 1440 Errors, with silliness such as failure to recognize anything inside "System.Xml".

    "The type or namespace name 'Xml' does not exist in the namespace 'System'...

    The references are still there, as always, and intellisense even shows "System.Xml", but the compiler thinks it doesn't exist.

    The reference shows: System.xm, version 2.0.5.0. (the only version available for me to choose)

    Still no solution here.

  • BrianKnoxBrianKnox USMember ✭✭

    Jim, thanks for the response. I did do a full "Clean", and full "Rebuild". The errors happening are at the compiler stage.

  • BrianKnoxBrianKnox USMember ✭✭

    I did a fresh checkout into a brand new folder location. Still getting 53K errors. Checked "TargetFrameworkVersion" which says v1.0 -- same as the version for all DLL's I'm referencing (e.g. System, System.xml).

    It seems like I've got an issue with target framework, but the versions inside the csproj file seem to be correct.

  • BrianKnoxBrianKnox USMember ✭✭

    FOUND MY ISSUE! DUMB AS HELL.

    In Visual Studio, for project options, "General" settings, I simply needed to

               UNCHECK "Do not reference mscorlib.dll".
    

    I've had that box checked for years, without issue. But with this last release of Xamarin, suddenly that makes everything break, and without apparent reason. And nothing I found online told me this could be the culprit.

    I found this fix via just random editing of the project settings, until suddenly it worked.

    We're back in business again.

Sign In or Register to comment.