invalid options 'latest' for langversion; must be ISO-1, ISO-2, default or an integer in range 1 to 6
- Error: CS1617: Invalid option 6 for langversion
- ix Error Invalid option '6' for langversion; must be ISO 1, ISO 2, 3, 4, 5 or Default
- Error Invalid option '6' for /langversion; must be ISO-1, ISO-2, 3, 4, 5 or Default
- Compiler Error CS1617
- Invalid option 'latest' for /langversion; must be ISO-1, ISO-2, Default or an integer in range 1 to
I was upgrading my MVC app from MVC 4 to MVC 5 in visual studio 2013 then eventually got message CS1617: Invalid option '6' for langversion. I looked into issue very closely and then finally come up with the right solution. I am here demonstrating complete resolution with you.
How to Fix Error Invalid option '6' for langversion; must be ISO 1, ISO 2, 3, 4, 5 or Default
I am trying to target .NET 4.6 and also take advantage of the latest C# version by changing the C# language version to 6.
Invalid option 'option' for LangVersion. Use
You may be thinking that C# 7 features are already supported with Visual Studio 2017 and you do not need to make any changes for that. Yes, you are almost right but this is not 100% true.
Wait for a while and let me explain. If you open Visual Studio 2017 and start compiling the code which was introduced with C# 7 then most of the features will be compiled successfully and you do not need to make any changes for the language version.
But if you will check the currently selected C# language version then you will find that it is “default” not “C#7.0”. Let’s check it.
No comments:
Post a Comment