6
votes

I'm slowly migrating projects to VS2017 from VS2015. We have distributed team and until all is verified (there are issues with e.g. Reporting Services, SSIS, etc as there is not fully finished tooling - SSDT) I need the projects could work in VS2015 without changes.

C# projects in VS2017 use latest C# version by default in project settings (in my case it is C# 7.1) and ReSharper started to offer refactoring to these new features. However, I need to resist the temptation and wait until all is migrated (while I still need to be able to write and review code). I need to specify the version of C# to be 6.0. I can do it on per project basis but I would like to avoid this as I would have to go through each project, modify it and push it to source control and when the migration is done then I would have to switch it back.

Is there a way in R# to globally set the C# version in options (haven't found such a setting but maybe there's some hidden option?)

(VS2017 - 15.4.5, ReSharper 2017.2.2)

EDIT For Typescript there is possibility to specify language level - either auto-detection or exact version. So for C# it could be similar - auto-detection from project settings or exact version. It would allow code review for specific language version without modification of the projects.

I'm adding here also the link to R# support page as I asked there too

1

1 Answers

9
votes

Add the following string to solution settings file ({Solution name}.sln.DotSettings file in the solution's root folder)

<s:String x:Key="/Default/CodeInspection/CSharpLanguageProject/LanguageLevel/@EntryValue">CSharp60</s:String>