Build failed. Could not find type 'System.Globalization.SortVersion'

I recently updated my development environment to 4.2.4 Build 35 and I can no longer build our solution. Xamarin Studio fails with an error that states:

Build failed. Could not find type 'System.Globalization.SortVersion'.

This happens when it tries to build or clean the very first project in the dependency tree in the Solution.

I upgraded to 4.2.5 Build 0 this morning and the problem is still there. Tried on multiple machines with multiple OSes (Win7 and Win8) and the failure continues, so it's not an environment problem.

It's definitely a problem in Studio, as the build server, which uses gmcs through Jenkins continues to build the solution without any problem.

Rolling back to 4.2.3 Build 60 eliminates the error.

Posts

  • mhutchmhutch USMember, Xamarin Team Xamurai

    Are you trying to build on Windows with Mono as the runtime?

  • ChristopherTackeChristopherTacke USMember ✭✭

    Yes, that is correct. Building on Windows, using Mono as the runtime.

  • mhutchmhutch USMember, Xamarin Team Xamurai

    This is due to a change in the .NET binary serialization compatibility in .NET 4.5.1, which affects the remoting channel XS uses to connect to the builder process. It should be fixed in the next version of Mono.

    That said, I'd recommend building using .NET for building on Windows, since we don't really test the Mono build engine on Windows. If you just want to check Mono compatibility, you can use Run->Run with-> Mono to run on Mono, even when building with .NET.

  • DavidKarlaDavidKarla SIMember, Xamarin Team Xamurai

    Workaround that I use is to open project settings and uncheck Build->General->Use MSBuild build engine.

  • I solved the problem in the past with "uncheck Build->General->Use MSBuild build engine.", however in the latest version (5.2) that option is not available.

    Is there a new fix for this very old problem?

  • vladruvladru RUMember
    edited August 2014

    Michael,
    in the 5.2. version You can find 'Use MSBuild engine' option at
    Project -> YourProjectName Options -> General

  • tyronevergiltyronevergil PHMember

    Hi Vlad, I can't find the MSBuild option in Xamarin 5.2 (build 386). Is there any simpler work around? Thanks!

  • vladruvladru RUMember
    edited August 2014

    Tyrone,
    I`ve mark the 'project options' menu item in Xamarin 5.2. on the picture (attached to the next post).
    Then select Build -> General and uncheck 'Use MSBuild engine' option .

  • vladruvladru RUMember

    Image for previos post:

  • MichaelNiemannMichaelNiemann USMember
    edited August 2014

    vladru,

    Here is what my Build/General window looks like (5.2, 5.2.1):

    There is no way to uncheck 'Use MSBuild engine' option... it no longer exists!

    Regards,
    MikeN

  • vladruvladru RUMember

    Michael,
    My windows are attached.
    I use Mono3.3.0.
    May be You have old versions of Mono ?

  • vladru,

    I am using Mono 2.10.9 as the Active Runtime. Since I also have 3.3.0 installed, I tried that as well. No change.

    I will fall back to XS 5.1.2, the last version that works for me.

    Thank you for your assistance, but this seems like a long-time problem for XS... perhaps it will eventually be fixed.

    MikeN

  • mhutchmhutch USMember, Xamarin Team Xamurai

    Is there any particular reason why you need to use the Mono runtime to compile your project?

  • Michael,

    Why would I want to build against a different runtime than I plan to execute against? It would require a lot of faith to believe that building against a different runtime would flawlessly execute against a different runtime (especially a runtime with a lower version number).

    That way I can test in Windows, and confirm on Linux (the ultimate execution environment).

    There are many things that work fine with .Net runtimes that fail under mono/.net runtimes... which is a different issue that getting the build to work... but it contributes to my skepticism about building against a different set of runtimes.

    MikeN

  • mhutchmhutch USMember, Xamarin Team Xamurai
    edited August 2014

    Building and execution are very different. When you build, you use a toolchain - some MSBuild implementation, which will use compilers and other tools - to build your source code against compile-time assemblies, creating an assembly. At runtime, a runtime loads your assembly and resolves its references against runtime assemblies.

    The assemblies used at compile-time and at runtime don't have to be the same, they just have to have the same API. In fact, they aren't the same even on .NET. And differences in the implementation of the compile-time assemblies won't affect what happens at runtime. You may catch superficial API differences, but not implementation differences, and that's where real issues usually lie.

    If you're a desktop/server framework such as .NET 4.5 then there are essentially three areas of compatibility:

    1. Toolchain - the .NET/Mono toolchains produce assemblies that are compatible
    2. API - Mono has the same APIs as .NET
    3. Runtime - the Mono APIs are implemented and behave the same way as .NET

    Right now on Windows the .NET toolchain is better tested and tuned than Mono's, and produces assemblies that work perfectly well on Mono, so there's not much reason to support the Mono toolchain on Windows. I'd love to support it but it offers very little concrete benefit and makes a lot of things very complicated. It's likely we'll remove Xamarin Studio's support for the Mono toolchain on Windows in the future.

    Xamarin's products use the .NET toolchain for building Xamarin.Android and Xamarin.iOS apps on Windows - they're compiled with .NET's MSBuild, using .NET's C# compiler. However, they're built against Mono reference assemblies. And at runtime they run on Mono.

    As long as you're not using the big unsupported areas like WPF, or advanced MSBuild customization, then almost all of the issues you run into will be runtime. And you're worried about API differences you can set MSBuild properties to have it build against the Mono framework assemblies, while still using the .NET toolchain.

  • Michael,

    Thank you for the thorough explanation!

  • GaryDaviesGaryDavies AUMember

    I created a project named App.Windows in VS2013, the . causes the issue. I created a new project named AppWindows (without the .), builds without errors.

Sign In or Register to comment.