This project is read-only.


Resharper - Ignore decompiled/read-only/locked files


Applies to StyleCop, Resharper and VS2010 Pro.

The built-in decompiler of R# produces temporary files which are loaded as read-only in VS.
These are analyzed by the StyleCop online checking and of course produce a lot of violations.
All these notices of violations do is add visual clutter, because as the files are read-only they can not be changed.

Currently the only workaround is to exclude these temporary files from the list of parsed files, but I request a more permanent solution.

And because the part about visual clutter applies to all read-only files, I suggest an option to turn off online checking for read-only files altogether.

(This is my first bug report ever, so please be gentle)

file attachments

Closed Aug 1, 2013 at 3:16 PM by andyr
Closing all Resolved items.


andyr wrote Feb 28, 2012 at 1:21 AM

Brace yourself, I'll try to be gentle :-)
Most source control systems will place the files on your local drive as read-only. So this wouldn't work. However, if anyone can think of a different way of consistently identifying the decompiled files I'll add the feature

diabol wrote Mar 2, 2012 at 2:27 AM

Hi andyr, thanks for the response.
I am not sure if we are on the same page here, so I will clarify:
What I mean by "read-only" is not filesystem-level read-only, but loaded as read-only in VS, the same thing which happens when you start the debugger and VS prevents you from editing the file (as shown in the attachment).

IMO the highlighting is visual clutter for any file which VS prevents you from editing and should be turned off for these as well (others may disagree on this, of course).
Also, R# turns off it's built-in highlighting for decompiled files, so there might be something in the SDK (have not looked yet).
Apart from that I do not see a clean way to identify decompiled files.

andyr wrote Mar 24, 2012 at 12:14 AM

VS will show that for any file marked as readonly. Some source control systems will mark all the local files as readonly (locked) until you start to edit them. I'd need to find another way of identifying the files.

DanielRose wrote Apr 10, 2012 at 10:51 AM

Two ideas:
1) Many source control systems don't use read-only for local files (ex. CVS, SVN, Git, Mercurial, ...). The only one I know of is TFS. So at least an option to ignore read-only files would be nice.
2) Resharper gives the decompiled files a standard header. Perhaps you can look for that header (here's an example for System.Threading.Thread):

// Type: System.Threading.Thread
// Assembly: mscorlib, Version=, Culture=neutral, PublicKeyToken=b77a5c561934e089
// Assembly location: C:\Windows\Microsoft.NET\Framework\v4.0.30319\mscorlib.dll

andyr wrote May 2, 2012 at 2:51 PM

I've added a feature to choose whether to analyse decompiled files in the ReSharper options. Its off by default in 4.7.19.

andyr wrote May 2, 2012 at 2:53 PM

Fixed in 4.7.19 with changeset 484b2a6cd65d