No built-in types vs. built-in types Follow
Answered
I've the following code:
var a = string.Empty;
ReSharper suggests me to change this to CLR type name - what is ok.
I change it to "String.Empty"
Then I apply a Silent Cleanup Code (Resharper->Edit->Silent Cleanup Code) and ReSharper changed all "String.empty" back to "string.empty" ... complaining afterwards, I should use CLR - what I really want :-)
Where is the option to change this behavior of ReSharper?
Thanks
Konrad
Please sign in to leave a comment.
Hello Konrad,
Thanks for the settings file and the info.
Seems like StyleCop plugin is a root of the problem. If you disable "For Stylecop violation | Fix Stylecop violation" on "ReSharper | Opitons | Code Editing | Code Cleanup" page for a profile - the issue will stop happening.
It looks as if it is still apply SA1121 rule despite the fact it is disabled in "Inspection Severity" section.
So, please consider opening a new issue on https://github.com/StyleCop/StyleCop/issues page.
Thanks!
Please select ReSharper | Options | Code Editing | C# | Code Style | Built-in type naming | When referencing built-in type, prefer using | CLR type name.
Thanks!
Thanks for your answer.
But this option was and is set.
ReSharper still converts:
to
Hello Konrad,
Please:
Thanks!
1. C# Version: 6.0 - Visual Studio 2015 Enterprise
2. There is only one plugin installed: StyleCop by JetBrains 2016.1.0
3. Here are the ReSharper-Settings: https://www.dropbox.com/s/crgg671e4erqjd5/reSharperSettings.DotSettings?dl=0
Hi Alexander,
this worked perfectly!
Thank you for your fast and capable help :-)
Konrad
You are welcome!