'Refactoring failed - Files still read-only' error message when applying Quick Fix

If you get the 'Refactoring failed - Files still read-only' as follows:

 

for VS2012:

Please update 'Visual Studio Tools for Git' extension to the latest version (this issue was fixed since version 0.9.5.0 of this addin). You may do that via VS Extension Manager ("Tools | Extensions and Updates").

If the issue is still present after the update, please disable/remove the 'Visual Studio Tools for Git' extension from the Visual Studio.

 

for VS2013/VS2015:

Please disable embedded GIT provider in Options: Tools | Options | Source Control | Plug-in selection | Select "None";

 

 

55 comments
Comment actions Permalink

I have this problem with Visual Studio 2019.

 

Update (2022-07-29):

I updated bother ReSharper and VS to the most recent, and the problem went away.

 

Update (2022-08-01):

The problem has reappeared, and I posted my system information in a different comment below.

Edited by John Hildebrant
0
Comment actions Permalink

Hello everyone,

We've discovered that the problem seems to be related to some VS A/B testing mechanism which could remotely enable and disable features for users
Please try the suggestion from this comment and let me know how it goes for you. 
Thank you.

0
Comment actions Permalink

Hi Angelina,
this seems to fix the problem. Also the one where adding classes wasn't possible anymore.
It only works when I execute the cmd as mentioned, which includes the registry fix. Only merging the reg file and then starting VS as usual didn't help.

Thanks for your help and best regards

0
Comment actions Permalink

This issue started for me last week. Here's my configuration:

JetBrains ReSharper 2022.1.2 Build 221.0.20220601.154737 built on 2022-06-01
ReSharper 2022.1.20220601.161736

Microsoft Visual Studio Enterprise 2019
Version 16.11.17
VisualStudio.16.Release/16.11.17+32630.194
Microsoft .NET Framework
Version 4.8.04084

Installed Version: Enterprise

Visual C++ 2019   00435-60000-00000-AA439
Microsoft Visual C++ 2019

.NET Core Debugging with WSL   1.0
.NET Core Debugging with WSL

ADL Tools Service Provider   1.0
This package contains services used by Data Lake tools

ASA Service Provider   1.0

ASP.NET and Web Tools 2019   16.11.110.1451
ASP.NET and Web Tools 2019

ASP.NET Web Frameworks and Tools 2012   16.11.110.1451
For additional information, visit https://www.asp.net/

ASP.NET Web Frameworks and Tools 2019   16.11.110.1451
For additional information, visit https://www.asp.net/

Azure App Service Tools v3.0.0   16.11.110.1451
Azure App Service Tools v3.0.0

Azure Data Lake Node   1.0
This package contains the Data Lake integration nodes for Server Explorer.

Azure Data Lake Tools for Visual Studio   2.6.1000.0
Microsoft Azure Data Lake Tools for Visual Studio

Azure Functions and Web Jobs Tools   16.11.110.1451
Azure Functions and Web Jobs Tools

Azure Stream Analytics Tools for Visual Studio   2.6.1000.0
Microsoft Azure Stream Analytics Tools for Visual Studio

C# Tools   3.11.0-4.22108.8+d9bef045c4362fbcab27ef35daec4e95c8ff47e1
C# components used in the IDE. Depending on your project type and settings, a different version of the compiler may be used.

Common Azure Tools   1.10
Provides common services for use by Azure Mobile Services and Microsoft Azure Tools.

Fabric.DiagnosticEvents   1.0
Fabric Diagnostic Events

File Differ   2.0.28
The easiest way to diff two files directly in Solution Explorer

IntelliCode Extension   1.0
IntelliCode Visual Studio Extension Detailed Info

JetBrains ReSharper 2022.1.2   Build 221.0.20220601.154737
JetBrains ReSharper package for Microsoft Visual Studio. For more information about ReSharper, visit http://www.jetbrains.com/resharper. Copyright © 2022 JetBrains, Inc.

Markdown Editor   1.12.253
A full featured Markdown editor with live preview and syntax highlighting. Supports GitHub flavored Markdown.

Microsoft Azure HDInsight Azure Node   2.6.1000.0
HDInsight Node under Azure Node

Microsoft Azure Hive Query Language Service   2.6.1000.0
Language service for Hive query

Microsoft Azure Service Fabric Tools for Visual Studio   16.10
Microsoft Azure Service Fabric Tools for Visual Studio

Microsoft Azure Stream Analytics Language Service   2.6.1000.0
Language service for Azure Stream Analytics

Microsoft Azure Stream Analytics Node   1.0
Azure Stream Analytics Node under Azure Node

Microsoft Azure Tools for Visual Studio   2.9
Support for Azure Cloud Services projects

Microsoft Continuous Delivery Tools for Visual Studio   0.4
Simplifying the configuration of Azure DevOps pipelines from within the Visual Studio IDE.

Microsoft JVM Debugger   1.0
Provides support for connecting the Visual Studio debugger to JDWP compatible Java Virtual Machines

Microsoft Library Manager   2.1.126+g11d4cf0d0c.RR
Install client-side libraries easily to any web project

Microsoft MI-Based Debugger   1.0
Provides support for connecting Visual Studio to MI compatible debuggers

Microsoft Visual C++ Wizards   1.0
Microsoft Visual C++ Wizards

Microsoft Visual Studio Tools for Containers   1.2
Develop, run, validate your ASP.NET Core applications in the target environment. F5 your application directly into a container with debugging, or CTRL + F5 to edit & refresh your app without having to rebuild the container.

Microsoft Visual Studio VC Package   1.0
Microsoft Visual Studio VC Package

NuGet Package Manager   5.11.2
NuGet Package Manager in Visual Studio. For more information about NuGet, visit https://docs.nuget.org/

ProjectServicesPackage Extension   1.0
ProjectServicesPackage Visual Studio Extension Detailed Info

Razor (ASP.NET Core)   16.1.0.2122504+13c05c96ea6bdbe550bd88b0bf6cdddf8cde1725
Provides languages services for ASP.NET Core Razor.

Snapshot Debugging Extension   1.0
Snapshot Debugging Visual Studio Extension Detailed Info

SQL Server Data Tools   16.0.62205.05200
Microsoft SQL Server Data Tools

ToolWindowHostedEditor   1.0
Hosting json editor into a tool window

TypeScript Tools   16.0.30526.2002
TypeScript Tools for Microsoft Visual Studio

Visual Basic Tools   3.11.0-4.22108.8+d9bef045c4362fbcab27ef35daec4e95c8ff47e1
Visual Basic components used in the IDE. Depending on your project type and settings, a different version of the compiler may be used.

Visual F# Tools   16.11.0-beta.21514.6+b6c2c4f53ea3a08fa603ea93d6d2f808a62a21d1
Microsoft Visual F# Tools

Visual Studio Code Debug Adapter Host Package   1.0
Interop layer for hosting Visual Studio Code debug adapters in Visual Studio

Visual Studio Container Tools Extensions   1.0
View, manage, and diagnose containers within Visual Studio.

Visual Studio Tools for Containers   1.0
Visual Studio Tools for Containers

Visual Studio Tools for Kubernetes   1.0
Visual Studio Tools for Kubernetes

0
Comment actions Permalink

Hello John Hildebrant

Please try the suggestion from this comment and let me know how it goes for you. 
Thank you.

0
Comment actions Permalink

Hello everyone,

We have received a message from the Microsoft team that they have fixed the issue. So now everything should work fine without our workaround. Please let us know if it's not.

3
Comment actions Permalink

For me it seem to work.
The "MoveToFile" issue and the problem with adding new classes work now.

Thanks for your efforts and best regards

0
Comment actions Permalink

Yesterday I updated my VS 2022 to the latest and Resharper started working at 2019. Thanks guys 👍

0
Comment actions Permalink

This morning (Aug 26, 2022), I updated to VS 2019 Community 16.11.18 (Visual C++) and ReSharper 2022.1.2 and had the bug: 'Refactoring failed - Files still read-only' which lead me on this page...

0
Comment actions Permalink

This issue is caused by a Visual Studio's bug.

(Maybe fixed in next build)

VS2019 Professional/Enterprise is avoided by deploying new remote configurations.
But VS2019 Community is still bugging.
(I think Microsoft is not deploying to Community edition users)

If you think use workaround, please check the comment.

Edited by Tanza
0
Comment actions Permalink

Thank you for your quick answer, Tanza!

I tried to add the line in bold in .gitignore:

# ReSharper is a .NET coding add-in
_ReSharper*/
*.[Rr]e[Ss]harper
*.DotSettings.user
 _ReShaper.Caches

 

but it still does not work. I will look to the other propositions made in the discussions your message dotted at and will come back if any of them work.

0
Comment actions Permalink

Dear Frederic, please read previous comment.

This support page is not for VS2019.
Recent issues in VS2019 are discussed in the comments section and on YouTrack.

 

ex: https://youtrack.jetbrains.com/issue/RSRP-338404/Refactoring-failed-File-still-readonly#focus=Comments-27-6352455.0-0

* If not focused to comment, please find "temporary workaround".

Edited by Tanza
0
Comment actions Permalink

dear Tanza,

thank you, I was confused indeed. The registry corrective provided by Denis Korneev (28 Jul 2022) in the zip file "vs2019_gitplugin_fix.zip" fixes the problem.

0
Comment actions Permalink

Hi all after seeing this problem for the second time in years, I used the age old trick to fix everything with a new update of resharper (as I usually do)

Resharper -> Options -> CleanCache -> Restart VS 2019 -> Let it rebuild the intellisense -> Try Refactor moving a file or class -> it works again as usual. 

It seems like between upgrades the Resharper Cache is locking something.

Just wanted to share how I was luckily able to get around this insane bug.

 

0
Comment actions Permalink

Angelina Elycheva thanks for the suggestion:

Hello John Hildebrant

Please try the suggestion from this comment and let me know how it goes for you. 
Thank you.

This still does not work for me. I'm in VS 2019. 

JetBrains, please prioritize this fix. It is a blocking issue for me. In fact, even after restarting Visual Studio, I still cannot refactor a method name. This is really, extremely frustrating and an incredible waste of time for us to deal with.

Edited by gruthor
0
Comment actions Permalink

gruthor wrote:

JetBrains, please prioritize this fix.

This issue in VS2019 is caused by Visual Studio's bug.
https://developercommunity.visualstudio.com/t/Visual-Studio-2019-Git-plug-in-breaks-IV/10111861

Currently, I think this issue is only on Community edition.

I think you have following options:

  • Upgrade Visual Studio to Professional edition or Enterprise edition (You should try the evaluation version before you buy it)
  • Migrate to Visual Studio 2022
  • Run with temporary workaround batch provided from Denis Korneev (28 Jul 2022) everytime. (Of course, you need to correct the file path for Community edition)
  • Try unofficial workaround extension
  • Wait that Microsoft will fix. (Unfortunately, bugfix is not included in 16.11.19)
Edited by Tanza
1
Comment actions Permalink

Tanza

Just installed your extension on VS 2019 (stuck with it due to Unity 3D) and it seems to be working. Thank you very much for this.

0
Comment actions Permalink

Hello Dev Sa, gruthor

Could you please let us know the following info:

  • Do you use VS 2019 Community version?
  • Do you have internet on the machine?
  • Is the following option enabled in VS - Tools | Options | Environment | Accounts | Synchronize Visual Studio settings accross devices..?

Thank you in advance.

Edited by Angelina Elycheva
0
Comment actions Permalink

Angelina Elycheva

Yes to all, as well.

The fix Tanza posted appears to have solved the issue.

Thanks.

0
Comment actions Permalink

Hello Dev Sa, gruthor

thank you for the replies.

Could you please check if the issue is reproduced when the workaround is not applied? It seems that the issue should be fixed now for Community users as well.

0
Comment actions Permalink

Angelina Elycheva Sure. Can you explain the best way to uninstall the workaround to test this?

0
Comment actions Permalink

gruthor

If you had used the extension fix please find the extension (GitFeatureFlagAdjusterForRsharp) in VS Extensions | Manage Extensions and select to uninstall it.

0
Comment actions Permalink

Angelina Elycheva

I tested on Community edition, issue is solved now!
(And I confirmed "Git.Operation.EphemeralEditsUseDirtyAttributeOnly" flag in registry is set to 0.)

Thank you and your team members for working on these issues.

----

[Information]

Steps for uninstalling extension

  1. Use the following pages to open the Manage Extensions dialog box.
    https://learn.microsoft.com/en-us/visualstudio/ide/finding-and-using-visual-studio-extensions?view=vs-2019
  2. Select "Installed" node in left side pane.
  3. Find "GitFeatureFlagAdjusterForRsharp"
  4. Select it and click "Uninstall" button.
  5. Restart Visual Studio.
Edited by Tanza
1
Comment actions Permalink

Angelina Elycheva yes, the new version of VS Community solved the issue. Thanks!

0

Please sign in to leave a comment.

Have more questions?

Submit a request