2

ReSharper on Visual Studio 2015 is generating C#6-style formatting members (using string interpolation) despite my project targeting .NET 4.5.

Is there a way to instruct it to use string.Format? Ideally, based on the version of the .NET framework my project targets?

Michael
  • 430
  • 3
  • 8

1 Answers1

1

ReSharper uses its own C# Language Level property at the View -> Properties Window. So you may set it to C#5 or below.

https://www.jetbrains.com/resharper/help/ReSharper_by_Language__CSharp.html

Ilya Chumakov
  • 23,161
  • 9
  • 86
  • 114
  • 1
    Thanks, I've accepted your answer. I also want to add that Language Level is different from Target framework, which is what I was initially trying to no avail. Just noting it for posterity's sake because this differentiation in VS is confusing. The former (and the one that drives this) is set in the Properties Window, and the latter is set in the Property Pages. – Michael Nov 24 '15 at 22:30
  • Glad to help. Also I've corrected the answer to prevent misunderstanding between these windows, thanks! – Ilya Chumakov Nov 25 '15 at 19:27
  • It would be nice to have it based on project targeting. It is a bit annoying to set the level for every project in solution. And not to forget to increase it back once solution get upgraded to next level. – Ben Jan 26 '16 at 20:40
  • @Ben look on it for the solution-wide setting: http://stackoverflow.com/a/31592662/5112433 – Ilya Chumakov Jan 27 '16 at 08:25