Notice (2018-05-24): bugzilla.xamarin.com is now in
Please join us on
Visual Studio Developer Community and in the
Mono organizations on
GitHub to continue tracking issues. Bugzilla will remain
available for reference in read-only mode. We will continue to work
on open Bugzilla bugs, copy them to the new locations
as needed for follow-up, and add the new items under Related
Our sincere thanks to everyone who has contributed on this bug
tracker over the years. Thanks also for your understanding as we
make these adjustments and improvements for the future.
Please create a new report on
Developer Community or GitHub with
your current version information, steps to reproduce, and relevant error
messages or log files if you are hitting an issue that looks similar to
this resolved bug and you do not yet see a matching new report.
Description of Problem:
Steps to reproduce the problem:
1. create a new "Android Application"
2. popup "Project Options"
3. In "Build" / "General" section, You can change "C# Language Version" as "Default", "ISO-1", "ISO-2", Version 2, Version 4, Version 5
4. Select "Version 5"
5. Try build, it will fail with this error message "Invalid option 'Version5' for /langversion; must be ISO-1, ISO-2, 3, 4, 5 or Default (CS1617)"
CS1617 error occurred
It has to build with option "Version5"
How often does this happen?
Open .csproj directly in notepad
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
you change "Version5" to "5" and save it.
It will work!
We have check this issue with following builds:
Mono Framework 2.10.11
1. On selecting 'Version 5', 'Version 4' in "C# Language Version", we are still getting same build error:
"/Users/apple/Projects/ss/ss: Error CS1617: Invalid -langversion option `5'. It must be `ISO-1', `ISO-2', `3' or `Default' (CS1617)".
2. On selecting 'IOS-1' in "C# Language Version", we are getting 18 build error.
Build output: https://gist.github.com/atin360/8470a8ba83f7ba804308
3. On selecting 'ISO-2', 'Version 3' and 'Default' android application build successfully.
On opening .csproj directly in notepad, for different "C# Language Version" it displays:
<LangVersion>5</LangVersion> for 'Version 5'
<LangVersion>4</LangVersion> for 'Version 4'
<LangVersion>ISO-1</LangVersion> for 'ISO-1'
<LangVersion>ISO-2</LangVersion> for 'ISO-2'
1. On selecting 'Version 5', 'Version 4', 'Version 3', 'ISO-2' and 'Default' android application build successfully.
2. On selecting 'IOS-1' in "C# Language Version", we are getting 15 build errors.
Build output: https://gist.github.com/atin360/d33c8528a55b66963061
Note: On opening .csproj directly in notepad, it displays <LangVersion>ISO-1</LangVersion> for 'ISO-1' C# Language Version.
Hence, reopening this issue.
What git revision are you testing? This was fixed in 5263deb8b7e65a5b59482d15b766d2cfec9dfe21 which may have not made it into 4.0.2.
It was fixed on the 23rd, well before we branched 4.0.2, git branch --contains backs this up:
dynamic-044:monodevelop pjbeaman$ git branch --contains 5263deb8b7e65a5b59482d15b766d2cfec9dfe21
(git branch --contains lists the branches that contain the commit and xs-4.0.2 is on the list)
I've got a bit more info for you:
1) This is a separate bug. The version is being passed correctly by Xamarin Studio, but the compiler is not supporting version 5.
This issue should be filed separately and will be fixed by Mono 3.0
2) This is expected behavior. The project you are building uses features that are not available in C# version 1. The build errors should tell you this. Example:
"MainActivity.cs(26,53): error CS1644: Feature `generics' cannot be used because it is not part of the C# 1.0 language specification"
3) Sounds good!
1) Sounds good!
2) Same issue as 2 above, the project you are building requires features that aren't available in version 1 of C#.
Thanks for verifying! Please be sure to re-file MAC issue 1.
Based on comment 2, I'm VERIFYING that Xamarin Studio is now properly passing '5' instead of 'version5', which is the original issue.