Problem with saved formerly read-only files showing false errors
When I modify a file that is marked as read-only and try to save it, Visual Studio pops up a dialog that indicates the file is write-protected. I select "overwrite". At that point Resharper shows that there are errors on every variable and method call in the file. Closing the file and repoening the file does not help. I have to exit Visual Studio and restart it before resharper will show the file without all the red markings. A compile in Visual Studio (press F6) works fine with no errors, and shows "Build succeded".
Summary to reproduce the error:
1. Close Visual Studio.
2. Mark a file as read-only.
3. Open Visual Studio.
4. Change the file, and save it. Answer "Overwrite" to the pop-up dialog.
5. Resharper incorrectly shows red everywhere in the file.
I have Resharper 5.1.3000.12 on Visual Studio 2010, with the Microsoft Productivity Power Tools loaded. Disabling Productivity Power Tools does not help.
Do you have any suggestions on how to get Resharper to not show fake errors everywhere?
Is there a way to get Resharper to re-process the file without restarting Visual Studio?
(I'd submit a bug, but this problem does not always happen on my second computer).
Please sign in to leave a comment.
Hello Glade,
I'm afraid I wasn't able to reproduce this behavior. Does this happen for
you even in a newly created Class Library project? Could you please run Visual
Studio with /ReSharper.LogFile "C:\log.txt" /ReSharper.LogLevel Verbose,
repeat these steps and attach the resulting log file here? Thank you!
Andrey Serebryansky
Senior Support Engineer
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"
Attached log.txt from a session that failed.
Note that instead of just hitting ctrl-s to save, I usually hit F6 to recompile, which causes the save.
Attachment(s):
log.txt.zip
I tested with a new project with few files. The problem did not occur. I think the problem is somehow timing related.
Hello Glade,
I found nothing suspicious in the log file. Could you please monitor the
situation for some time and check if this behavior is related to a particular
file/project/solution? Also, could you please check if clearing caches (ReSharper
| Options | General -> Clear Caches) and reopening the solution helps to
cure this problem? Thank you!
Andrey Serebryansky
Senior Support Engineer
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"
Clearing the cache did not help.
Also, I see the problem in multiple files, projects, and solutions.
Hello,
Could you please attach a screenshot demonstrating the result of overwriting
the file (when ReSharper shows errors everywhere)? Thank you!
Andrey Serebryansky
Senior Support Engineer
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"
Attached is a screen capture. Notice that the mouse cursor is hovering over "programExitCode", showing the error "Cannot resolve symbol 'programExitCode'". That variable is declared at the top of the screen. Also see all the red for function calls such as "DisplayHelp();" "Initialize(args);". See also the red all the way through the file as indicated in Resharper's bar to the right of the scroll tool.
Attachment(s):
capture_04102011_093320.jpg
I was having a similar problem to the one described in this post. After reading that a new project fixed this issue I examined the differences between a project that exhibited the issue and one that did not. The only difference was my Code Analysis -> Rule Set was set to "Migrated rules for {project name}.ruleset". After changing to "AllRules.ruleset" the problem no longer occurs.
I believe the project was also complaining that the "Migrated rules for {project name}.ruleset" did not exist. Hope this helps.