Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
244 views
in Technique[技术] by (71.8m points)

c# - How to change language version in Visual Studio 2015

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.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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

enter image description here

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

enter image description here

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

enter image description here

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

enter image description here


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...