Roslyn Fixes String Alias ​​Fixes - Visual Studio 2015

I have Visual Studio 2015 with the latest Reshaper (9.1.2).

I usually use the style of referring to types and types of aliases as this answer describes . I like the general look of creating type aliased variable declarations and using the System type to express the static functions that exist on the type.

As an example:

string greet = String.Format("Hello {0}!", place);

      

With that said, I see a Roslyn code fix in my IDE to replace String for string. Before improving Roslyn

He asks to simplify ...

Roslyn Simplify the name 'String'

And exits changing only line to line: 'String' changed to 'string'

I want this change to be affected and why.

  • Is this just an improvement in compilation performance?
  • Does it add some minor runtime benefits?
  • Is there another reason why I should care about this code improvement?
+3


source to share


1 answer


So, even now in the latest version of Visual Studio (2015) and .NET (4.6), the string is still just an alias for String. This is just a style suggestion from Visual Studio.

For anyone else who might want to remove this code style ...



This setting can be turned off in: Tools => Options ... => Text Editor => C # => Code Style => Prefers inline predefined type keyword in membership access expressions.

Visual setting

+6


source







All Articles