在ReSharper中禁用C#6.0支持

时间:2014-12-23 13:34:11

标签: c# resharper

在使用ReSharper时,它建议"为此项目启用C#6.0支持"。我愚蠢地点击它,现在正如所宣传的那样,它给了我C#6.0的建议 - 然后给我错误,因为我在这个项目中没有使用C#6.0。

如何禁用C#6.0支持,将其恢复到以前的状态? (最好不必单独忽略具体建议)

2 个答案:

答案 0 :(得分:166)

单击解决方案资源管理器中的项目节点。然后查看属性网格(F4)。您将看到名为“C#语言级别”的属性。将其设置为“默认”或您想要的语言级别。

enter image description here

答案 1 :(得分:59)

要在解决方案中而不是按项目级别立即禁用它,请在.sln.DotSettings

中添加以下内容
<s:String x:Key="/Default/CodeInspection/CSharpLanguageProject/LanguageLevel/@EntryValue">CSharp50</s:String>

它会禁用resharper 6.0功能/给你错误

修改

根据评论,如果您根本没有sln.DotSettings文件,则需要创建一个包含以下内容的文件

<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation"> 
    <s:String x:Key="/Default/CodeInspection/CSharpLanguageProject/LanguageLevel/@EntryValue">‌​CSharp50</s:String>
</wpf:ResourceDictionary>