I have solution which was refactored from C# 6.0 to C# 5.0. What settings should I change in VS 2015 for check that uses of C# 6.0 syntax features are missing in my solution? Can I do this by other way?
Project->Properties->Build->Advanced->Language Version
You can enable this per-project.
In your project's properties, go to "Build", then "Advanced", then select your C# language version.
This settings is not perfect. That is, it can stop you from using some C# features, but it won't disable some changes in the compiler.
For example, C# 6 introduced improved overload resolution. This remains enabled regardless of what language version is selected in the project. This means that it is possible to write code in VS 2015 that does not compile in VS 2013, even if the language version is forced to C# 5.
If your intention is to use this so that you can guarantee your code will continue to compile with the true C# 5 compiler, then there isn't much you can do about it, however the overload resolution remains small corner-case.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With