The Problem:
Visual Studio 2013 fails to recognize C# 6.0 features like auto-property initializers.
Why This Happens:
Visual Studio 2013 lacks built-in support for C# 6.0. A compatible compiler is necessary.
The Solution: Using NuGet Packages
To enable C# 6.0 compilation and (partial) syntax highlighting, install the necessary NuGet packages:
<code>Install-Package Microsoft.Net.Compilers</code>
This package allows building projects with C# 6.0 syntax.
Important Considerations:
<code>Install-Package Microsoft.CodeDom.Providers.DotNetCompilerPlatform</code>
Alternative (Partial Support): Resharper
If you use Resharper, it may offer project-specific C# 6.0 support within its settings (.DotSettings).
Complete Solution: Upgrade Visual Studio
For full IntelliSense, code validation, and a seamless C# 6.0 experience, upgrade to Visual Studio 2015 or a later version.
The above is the detailed content of Why Doesn't Visual Studio 2013 Recognize My C# 6.0 Syntax?. For more information, please follow other related articles on the PHP Chinese website!