C# 6.0 Features Not Working with Visual Studio 2015
问题 I am testing Visual Studio 2015 with C# 6.0 but the language features are not working. In an MVC web application, the following code does compile: if (!string.IsNullOrWhiteSpace(Model.Profile?.TypeName)) { // More logic here... } However, when I run the application via Debug and IIS Express, I get the following error: CS1525: Invalid expression term '.' How do I enable these features? 回答1: This works in MVC 5 (tested 5.2.3), you just need to add the roslyn code dom Nuget package CodeDOM