How to change language version in Visual Studio 2015

|▌冷眼眸甩不掉的悲伤 提交于 2019-11-27 17:16:51

问题


I want to use the nameof operator in my C# project in Visual Studio 2015 but the compiler complains with the following message.

Feature 'nameof operator' is not available in C# 5. Please use language version 6 or greater.

I want to know how I can change the C# language version from Visual Studio 2015.


回答1:


Try this..

Project -> Properties -> Build -> Advanced -> Language Version




回答2:


Go to ProjectPropertiesBuildAdvancedLanguage VersionOK as shown with detail steps and screen shots below:

Follow these steps to change the language version of your project

1: Open your project with Visual Studio 2012, 2013 or 2015, click on View from Menu and then click on Solution Explorer

2: From Solution Explorer, Right Click on the project and Properties from context menu

3: From properties dialog, select the tab Build and click on Advanced button

4: Now, from Advanced Build Settings dialog, select Language Version and click OK button. Thats it.



来源:https://stackoverflow.com/questions/31912651/how-to-change-language-version-in-visual-studio-2015

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!