首页 \ 问答 \ VS2015 + Resharper:不要使用C#6(VS2015 + Resharper: Don't use C#6)

VS2015 + Resharper:不要使用C#6(VS2015 + Resharper: Don't use C#6)

我目前正在测试VS2015以了解它如何与我们的解决方案做出反应。 我遇到了一些麻烦,因为VS2015带来了C#6,这是我还不能使用的(因为我的同事没有这个,因为我们的构建机器在几个月前也没有这个功能)。

我看到我应该能够为每个项目语言版本指定C#5。 我为我们所有的项目(其中270个)做过。 现在,当我用C#6编译功能时,出现错误,这很好。

但是,resharper不断尝试让我使用表达式身体的属性,字符串插值,...

Resharper有没有提出这种改变的方法?


I've currently to test VS2015 to see how it reacts with our solution. I've some trouble because VS2015 brings C#6, which I cannot yet use(because my colleagues don't have this, because our build machine will also not have it before months).

I saw that I should be able to specify for each project language Version to C#5. I did it for all our projects(270 of them). Now when I compile with a C#6 feature, I've an error, which is good.

But, resharper keep trying to make me use Expression body for properties, string interpolation, ...

Is there a way that Resharper don't propose this kind of changes?

更新时间:2023-03-21 20:03

最满意答案

所以我明白你只是禁用了Roslyn的C#6支持:
项目属性/编译/高级/语言版本

但是您还必须 通过在解决方案资源管理器中选择一个项目,然后在属性窗口中更改以下内容, 告诉ReSharper不要提示C#6功能 (请参阅注释 ):

属性窗口

好消息是,您可以在解决方案资源管理器中一次选择多个项目。


So I understand you just disabled C#6 support in Roslyn using:
Project Properties/Build/Advanced/Language Version.

But you also have to tell ReSharper to not suggest C#6 features (see comments) by selecting a project in the solution explorer, and then changing the following in the properties window:

properties window

The good news is that you can select multiple projects at once in the solution explorer.

相关问答

更多
  • 此功能实际上源于ReSharper,但它也耦合到VisualStudio的选项对话框。 您需要启用ReSharper选项| 代码检查| 设置。 之后修改代码(以触发突出显示),并且可以从VisualStudio选项自由配置所需的所有颜色。 顺便说一下,属性的条目是'ReSharper Field Identifier'。 在各种情况下,自定义颜色真的很方便,例如,将实际方法与扩展方法,类与接口(如果不遵循DTE命名约定)或参考类型的值类型分开。 This feature actually originate ...
  • 看起来这些博客文章写的语法略有改变。 如错误信息所示,添加static到您的include语句: using static System.Console; // ^ class Program { static void Main() { WriteLine("Hello world!"); WriteLine("Another message"); } } 然后,您的代码将编译。 请注意,这只适用于声明为static成员。 ...
  • vs2015的新安装没有帮助。 全新安装的win10 + vs2015完成了这项工作:-( 失去了很多个小时但又回来了! New install of vs2015 didn't help. Fresh install of win10 + vs2015 did the job :-( Lost many hours but back running!
  • 它是Resharper 10(以及9的某些版本)和Specflow(绑定)的已知问题 上周我花了很多时间用它撞墙(有人决定升级到R#10,所有地狱都因测试而破裂) 经过几个小时的游戏,我发现某些版本适用于某些版本的specflow(目前)..版本网格图片(Selenium到Resharper版本组合工作) http://i.stack.imgur.com/Zxh9G。 png (文字,我不能发布超过2个链接-_-) 这有望成为一个短期问题(对于VS 2013/2015),因为有一些看起来像正在进行的修复。 ...
  • 您可以通过转到Properties => Build tab => Advanced button => Language Version并设置您的首选版本来单独设置每个项目的语言功能。 您应该意识到,它仍将使用新的“C#6.0”.Net编译器平台(代号为Roslyn)。 但是,该编译器将模仿较老的编译器的行为,并将限制您只能使用该特定语言版本的功能。 我不认为有一个解决方案范围的设置可用。 You can set the language feature for each project separate ...
  • 我已将您的代码修改为工作示例(未经过100%测试) template bool is_any_test_impl(T t) { return false; } template bool is_any_test_impl(T1 t1, T2 t2, Args&&... args) { return t1 == t2 || is_any_test_impl(std::forward(t1),std: ...
  • 未能升级VS2015的nuget 这个问题应该是核心visual studio可扩展性中的一个错误或问题。 这不是NuGet特定的问题。 它通常与诸如反病毒或加密服务等相关 。 我想在这里提供一些故障排除: 以管理员身份登录到计算机,并使用管理员启动Visual Studio。 检查您的计算机是否安装了McAfee Endpoint Encryption full-disk encryption product ,而不是防病毒软件。 如果是,则应该从全盘加密中排除devenv.exe和VSIXInstall ...
  • 所以我明白你只是禁用了Roslyn的C#6支持: 项目属性/编译/高级/语言版本 。 但是您还必须 通过在解决方案资源管理器中选择一个项目,然后在属性窗口中更改以下内容, 告诉ReSharper不要提示C#6功能 (请参阅注释 ): 好消息是,您可以在解决方案资源管理器中一次选择多个项目。 So I understand you just disabled C#6 support in Roslyn using: Project Properties/Build/Advanced/Language Vers ...
  • parent?.X类型parent?.X是float? ,你要添加到float - 导致另一个float? 。 这不能隐式转换为float 。 虽然Yuval的答案应该有效,但我会亲自使用以下内容: get { return (parent?.X ?? 0f) + position.X; } 要么 get { return (parent?.X).GetValueOrDefault() + position.X; } 我不确定你的设计,请注意 - 你在吸气器中添加东西而不是在设置器中添加 ...
  • C#6等字符串插值功能是编译器功能,而不是运行时(CLR)功能。 因此,只要您的编译器支持C#6,您就可以使用它们而不管您构建的.NET版本。 在Visual Studio 2015中,您可以在Properties => Build tab => Advanced button => Language Version控制您所定位的Language Version C# 6 features such as string interpolation are compiler features, not run ...

相关文章

更多

最新问答

更多
  • 在javascript中创建类以创建对象并在Java中创建类和对象之间的区别(Difference between creating a class in javascript to create an object and creating an class and object in Java)
  • Facebook API:将身份验证详细信息从Javascript SDK发送到PHP SDK(Facebook API: Send authentication detail from Javascript SDK to PHP SDK)
  • 如何停止队列动画jquery?(How can I stop queue animation jquery?)
  • 使用C#的井字游戏中的人工智能(Artificial Intelligence in Tic-Tac-Toe using C#)
  • 多少流量可以共享虚拟主机(对于Python Django站点)支持?(How Much Traffic Can Shared Web Hosting (for a Python Django site) support?)
  • 带有CIFilters的CAShapeLayer(CAShapeLayer with CIFilters)
  • 如何在Angular 2中读取JSON #text(How to read in Angular 2 the JSON #text)
  • 如何在xml中读取自闭标签的属性?(How to read self closing tag's attribute in xml?)
  • 无法使用http put将图像上传到亚马逊S3(Cannot upload image to amazon s3 using http put)
  • 文件结束无限循环(end of file infinite while-loop)
  • 在cpp的模板(template in cpp)
  • 在构建库时,clang和clang ++有什么区别?(What's the difference between clang and clang++ when building a library?)
  • ng类中的表达式(expression inside ng-class)
  • 在PHP中获取随机布尔值true / false(Get random boolean true/false in PHP)
  • 管道的高效分块用于严格的字节串(Efficient chunking of conduit for strict bytestring)
  • Python ternary_operator(如果其他标志做了其他操作,则执行其他操作)(Python ternary_operator (do-somthing if flag else do-another))
  • Sencha Touch面具发布(Sencha Touch mask ondisclosure)
  • 验证脚本上的通知[重复](Notices on validation script [duplicate])
  • 朋友功能(friend function)
  • 基于角坐标平移和变换平面几何(Translate and transform plane geometry based on corner coordinates)
  • Rails:'如果在本地运行'条件javascript标记包括(Rails: 'if running locally' conditional javascript tag include)
  • 解压文件(Unzipping files)
  • 使用ui-router以角度加载变量状态(loading in variable states with ui-router in angular)
  • 创建Azure云服务需要多长时间?(how long does it take to create an Azure Cloud Service? How to view log information?)
  • 指向整数的指针数组(Array of pointers to integers)
  • Laravel服务提供商没有看到我的包的主要类(Laravel service provider does not see the main class of my package)
  • 这个关于VSS / RSS / PSS / USS的解释是否准确?(Is this explanation about VSS/RSS/PSS/USS accurate?)
  • 在Django-Admin中通过row-id排序显示项目(Ordering the display items by row-id in Django-Admin)
  • 如何使用cythonize启用`--embed`?(How to enable `--embed` with cythonize?)
  • 用于将文本多行设置的Excel脚本(Excel script for ereasing text multiple rows)