C# 7 Regression?

Hi All,
I had been using Visual studio for Mac with C# 7.0. I've recently updated and now version 7 isn't working.

Specifically, I'm now getting errors like this:

/Users/tonyvalenti/Projects/TonyValenti/Clio.WebDav.git/AlphaDrive.Mac/CSC: Error CS1617: Invalid -langversion option 7'. It must be ISO-1', `ISO-2', Default or value in range 1 to 6 (CS1617) (AlphaDrive.Mac)


  • TonyValentiTonyValenti USMember ✭✭

    Just so you know, I have Xamarin Studio 6.3 (Build 863) installed and VS for Mac installed (7.0 build 2740).
    Xamarin Studio doesn't list C# 7.
    VS for Mac does but it doesn't work.

  • JGoldbergerJGoldberger USMember, Forum Administrator, Xamarin Team, University, Xamarin Moderator Xamurai


    When are you getting this error? I just tried to reproduce but could not. I started a new project, set it to use C# 7, and then did a quick test using a tuple and I did not get any errors. Can you provide steps to reproduce the issue?

  • LeenessLeeness USMember
    edited April 2017

    I am getting the same issues on VS & XS. I have tried making sure I am up to date in both IDEs. I even get intellisense telling me to use c# 7 features such as pattern matching & inline out declarations, but in the end I just get the usual error messages.

    Feature declaration expression' cannot be used because it is not part of the C# 6.0 language specification (CS1644)
    Invalid -langversion option 7'. It must be ISO-1, ISO-2, Default or value in range 1 to 6 (CS1617)

    Tested on a new project, too, it must be something else I am missing. VS on windows runs the C# 7.0 code with no issues.

    Did you manage to solve this issue @TonyValenti ?

  • TedRogersTedRogers USMember ✭✭✭✭

    @Leeness I just ran into this problem today. I can create new projects and use the new features but an older iOS project does not work. Did you or @TonyValenti resolve this issue?

    === Visual Studio Professional 2017 for Mac ===

    Version 7.1.5 (build 2)
    Installation UUID: 042b87d7-c3d5-4def-bf08-85f1e967d3a0
    Mono (d15-3/14f2c81) (64-bit)
    GTK+ 2.24.23 (Raleigh theme)

    Package version: 502000224

    === NuGet ===


    === .NET Core ===

    Runtime: /usr/local/share/dotnet/dotnet
    Runtime Versions:
    SDK: /usr/local/share/dotnet/sdk/1.0.3/Sdks
    SDK Version: 1.0.3
    MSBuild SDKs: /Library/Frameworks/Mono.framework/Versions/5.2.0/lib/mono/msbuild/15.0/bin/Sdks

    === Xamarin.Profiler ===

    Version: 1.5.5
    Location: /Applications/Xamarin Profiler.app/Contents/MacOS/Xamarin Profiler

    === Xamarin.Android ===

    Version: (Visual Studio Professional)
    Android SDK: /Users/trs2/Library/Developer/Xamarin/android-sdk-macosx
    Supported Android versions:
    7.1 (API level 25)

    SDK Tools Version: 26.0.2
    SDK Platform Tools Version: 25.0.6
    SDK Build Tools Version: 23.0.2

    Java SDK: /usr
    java version "1.8.0_101"
    Java(TM) SE Runtime Environment (build 1.8.0_101-b13)
    Java HotSpot(TM) 64-Bit Server VM (build 25.101-b13, mixed mode)

    Android Designer EPL code available here:

    === Xamarin Inspector ===

    Version: 1.3.0
    Hash: 8c298a5
    Branch: 1.3-release
    Build date: Thu, 14 Sep 2017 21:21:26 GMT
    Client compatibility: 1

    === Apple Developer Tools ===

    Xcode 9.0 (13247)
    Build 9A235

    === Xamarin.iOS ===

    Version: (Visual Studio Professional)
    Hash: 152b654a
    Branch: xcode9
    Build date: 2017-09-15 02:25:56-0400

    === Xamarin.Mac ===

    Version: (Visual Studio Professional)

    === Build Information ===

    Release ID: 701050002
    Git revision: 7afedcaef8e7542e70e3cf8f9bdb26938b8c0876
    Build date: 2017-09-15 08:39:58-04
    Xamarin addins: 3262aadf811a18c12eac6742532d052b0139a808
    Build lane: monodevelop-lion-d15-3-xcode9

    === Operating System ===

    Mac OS X 10.12.6
    Darwin 16.7.0 Darwin Kernel Version 16.7.0
    Thu Jun 15 17:36:27 PDT 2017
    root:xnu-3789.70.16~2/RELEASE_X86_64 x86_64

  • AhmadRazaNazirAhmadRazaNazir USMember ✭✭

    Any workaround? I'm facing same weird issue.

  • VolodymyrSavchenkoVolodymyrSavchenko UAMember ✭✭✭

    I faced this problem while updating xamarin.forms. The only problem was MonoFramework version. It was 4.8 which does not support C# 7. I changed default MonoFramework to version 5.10 and everything is fine now.

Sign In or Register to comment.