在 ReSharper 中禁用 C # 6.0支持

在使用 ReSharper 时,它建议“为该项目启用 C # 6.0支持”。我愚蠢地点击了它,现在就像广告上说的那样,它给我提供了关于 C # 6.0的建议——然后给我带来了错误,因为我在这个项目中没有使用 C # 6.0。

我怎样才能禁用 C # 6.0支持,让它恢复到以前的样子?(最好不要单独忽略具体的建议)

14973 次浏览

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

enter image description here

要在整个解决方案而不是每个项目级别立即禁用它,请在下面的 .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>