'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";

 

 

15 out of 45 found this helpful
55 comments

Big thanks to Ronnie Overby for noticing this ( blogpost).

0

Any update on this please? Still getting this error in R# 8.0 and Git Ext. 0.9.5.0 (VS 2012.3).

0

I am getting this same error on Visual Studo 2013, and you can't uninstall the Git tools, as now they are bundled in Visual Studio, and not an extension anymore.

How do we solve this problem?

0

@Giggio

Tools => Options => Source Control => Plug-in Selection

Set "Current source control plug-in" to "None".

If you use Git, use SourceTree as your client.

0

@T the GIT provider just switches on again every time when I open the solution, and it can't be disabled, is there another workaround for this?

0
Avatar
Permanently deleted user

I'm running into this in VS2013 with new projects. I have to add them to a Git repository before it will let me do refactorings like move class to a new file

0
Avatar
Permanently deleted user

Are there any plans to fix this bug?

0
Avatar
Permanently deleted user

I'm getting the same error when try to refactor files (very frustrating). Switching my source control plug-in to None is a work around for only so long...what's the eta on a perm fix?

  • JetBrains ReSharper 8.2 Full Edition Build 8.2.0.2160
  • Microsoft Visual Studio Ultimate 2013 Version 12.0.30110.00 Update 1
  • Microsoft .NET Framework Version 4.5.51641
0

@AlDass I'm not sure if JetBrains can fix this, it's a problem with the MS Git provider. 

If you want to completely disable the GIT provider (I also had performance issues, hanging Visual Studio, especially with large projects and lot's of JavaScript/TypeScript files) with it follow the steps here:

http://stackoverflow.com/a/23512676/67910

0
Avatar
Permanently deleted user

Problem still exists with

  • ReSharper C# 8.2.0.2160
  • Visual Studio Tools for Git 1.0
  • Visual Studio Pro 2012 (11.0.61030.00 Update 4)

Diasbling teh Git provider in teh Extension menu works just fine, but I hope that gets fixed very soon!

 

0

It is 2015 and this still happens in R# 9. I AM working with Git so I am not going to disable it, but this error is quite, quite annoying. So what's the status here.. is this going to get fixed?

0
Avatar
Permanently deleted user

I've just started experiencing this issue. We are using TFS not Git. I don't have any Git extensions installed.

Microsoft Visual Studio Professional 2012

Version 11.0.61030.00 Update 4

Microsoft .NET Framework

Version 4.5.51209

Installed Version: Professional

LightSwitch for Visual Studio 2012 04938-004-0033001-02468

Microsoft LightSwitch for Visual Studio 2012

Office Developer Tools 04938-004-0033001-02468

Microsoft Office Developer Tools

Team Explorer for Visual Studio 2012 04938-004-0033001-02468

Microsoft Team Explorer for Visual Studio 2012

Visual Basic 2012 04938-004-0033001-02468

Microsoft Visual Basic 2012

Visual C# 2012 04938-004-0033001-02468

Microsoft Visual C# 2012

Visual C++ 2012 04938-004-0033001-02468

Microsoft Visual C++ 2012

Visual F# 2012 04938-004-0033001-02468

Microsoft Visual F# 2012

Visual Studio 2012 Code Analysis Spell Checker 04938-004-0033001-02468

Microsoft® Visual Studio® 2012 Code Analysis Spell Checker

Portions of International CorrectSpell™ spelling correction system © 1993 by Lernout & Hauspie Speech Products N.V. All rights reserved.

The American Heritage® Dictionary of the English Language, Third Edition Copyright © 1992 Houghton Mifflin Company. Electronic version licensed from Lernout & Hauspie Speech Products N.V. All rights reserved.

Visual Studio 2012 SharePoint Developer Tools 04938-004-0033001-02468

Microsoft Visual Studio 2012 SharePoint Developer Tools

ASP.NET and Web Tools 2012.3.41009

Microsoft Web Developer Tools contains the following components:

Support for creating and opening ASP.NET web projects

Browser Link: A communication channel between Visual Studio and browsers

Editor extensions for HTML, CSS, and JavaScript

Page Inspector: Inspection tool for ASP.NET web projects

Scaffolding: A framework for building and running code generators

Server Explorer extensions for Windows Azure Web Sites

Web publishing: Extensions for publishing ASP.NET web projects to hosting providers, on-premises servers, or Windows Azure

CodeMaid #114

CodeMaid is an open source Visual Studio extension to cleanup, dig through and simplify our C#, C++, F#, VB, XAML, XML, ASP, HTML, CSS, LESS, SCSS, JavaScript and TypeScript coding.

Written by Steve Cadwallader, for more information visit http://www.codemaid.net/

JetBrains ReSharper Platform 6 Build 6.0.20141219.120158 on 2014-12-19 12:56:02Z

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

Microsoft Team Foundation Server 2012 Power Tools 3.0

Power Tools that extend the Team Foundation Server integration with Visual Studio.

Microsoft Visual Studio Process Editor 1.0

Process Editor for Microsoft Visual Studio Team Foundation Server

NuGet Package Manager 2.6.40627.9000

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

PreEmptive Analytics Visualizer 1.0

Microsoft Visual Studio extension to visualize aggregated summaries from the PreEmptive Analytics product.

ReadyRoll SQL Projects 1.10.0

Develop your databases 'online' and simplify deployment using ReadyRoll database projects.

Visit http://ready-roll.com for more information. Copyright © ReadyRoll Sql Pty Ltd. All rights reserved.

This software contains components licensed from ApexSQL.

This software contains components licensed from Component Owl.

ApexSQL is a registered trademark of ApexSQL, LLC.

SQL Server is a registered trademark of Microsoft Corporation.

ReadyRoll contains code from the following open source software:

NuGet https://nuget.codeplex.com/

SemVer .NET Api https://github.com/maxhauser/semver

Generate Sql Merge https://github.com/readyroll/generate-sql-merge

Menees Diff Controls http://www.menees.com/

Log4Net http://logging.apache.org/log4net/

Extended WPF Toolkit https://wpftoolkit.codeplex.com/

Code InfoBox VSX http://www.codeproject.com/Articles/55196/Code-InfoBox-Visual-Studio-Extension-VSX

SQL Server Data Tools 11.1.41025.0

Microsoft SQL Server Data Tools

TFS Auto Shelve 2.1

Create a shelveset for the latest version of all pending changes, automatically. Pending changes from the local TFS workspaces will be shelved to the TFS Server every "x" number of minutes when solutions are opened.

Web Essentials 3.8

Adds many useful features to Visual Studio for web developers.

0
Avatar
Permanently deleted user

I have the same problem with Resharper 9 and VS 2012, it says "Files still read-only:" and shows the corresponding .Designer.cs file of the control I'm editing even though it's not read only. I am using TFS, I do not have Git. Unless I can find a comfortable workaround I will have to stop using Resharper because of this.

0
Avatar
Permanently deleted user

I'm also noticing this issue, and it's getting kind of annoying:

Microsoft Visual Studio Enterprise 2015
Version 14.0.24720.00 Update 1

JetBrains ReSharper Ultimate 2015.2   Build 103.0.20150818.200216

 

I'm not about to disable my GIT plugin. That's kind of necessary.

0
Avatar
Permanently deleted user

It's frankly completely ridiculous this has not been fixed yet.

The "files still read-only" I can work around by git adding (or ignoring) all non-versioned files. Annoying, but not completely blocking.

But the (apparently related) "failed to modify documents" makes almost all refactorings nonfunctional.

Changing the source control provider is not even a quick fix anymore in VS2015 - it will cause a git-based solution to be closed.

0
Avatar
Permanently deleted user

Really? This is a solution? Somebody must be kidding. I use the Source tree as the main GIT tool, but some of the features integrated into VS simply are awesome. So if this is R# solution, then maybe sticking to CodeLens is a better alternative?

0

I concur - disabling the source control provider is very definitely *NOT* a solution to this issue.  Having just paid for a new ReSharper license to go with my new VS2015 license, I am *very* disappointed to learn that this long-standing issue has still not been resolved.

What use is a productivity tool that only works if you disable another productivity tool?

 

Come on JB, get it sorted out pronto!

0

I am currently experiencing the same problem using Visual Studio 2015 Enterprise (Version 14.0.25431.01 Update 3), Git Source Control Provider (1.6.5.1),  and JetBrains ReSharper Ultimate 2016.2.2 (Build 106.0.20160913.91321). This problem renders my ReSharper useless and turns ReSharper into expensive bloatware.

0
Avatar
Permanently deleted user

This happened to me when I was in debug mode. I stopped debugging, and all worked nicely then.

0
Avatar
Permanently deleted user

A workaround I found that worked for me is to use the Git Source Control Provider visual studio extension and not the Microsoft Git Provider.

0

I was consistently running into this issue and I think I figured out why (at least for me).  I had the ReSharper cache set to use the directory my project was in, this was locking a file and making git very unhappy:

error: open("_ReSharper.Caches/ReSharperPlatformVs147.Utilities.00/Db/LOCK"): Permission denied
error: unable to index file _ReSharper.Caches/ReSharperPlatformVs147.Utilities.00/Db/LOCK
fatal: adding files failed

 

To fix this I added the _ReShaper.Caches file to the .gitignore, and this seems to have cleared up the issue with the read only file errors.

 

Hope this helps!

1

I get this in Microsoft Visual Studio Enterprise 2019 Version 16.8.3
ReSharper 2020.3.20201223.82801

Source control is an Azure Devops Git repository.

Changing the Source Control Plug-in Selection to None is a workaround which works but would prefer this got fixed!

6

This issue suddenly started happening to me as well yesterday. It is debilitating as I cannot perform a majority of code refactoring activities.  If it is not fixed I will uninstall ReSharper and revoke my license.

Visual Studio Enterprise 2019 v16.11.15

ReSharper 2022.1.2 build 221.0.20220601.154737

*** UPDATE ***

As of the recently announced fix, I reinstalled ReSharper and the problem has been resolved.  Thanks for persisting to troubleshoot and fix the issue!

Edited by Leonard, Jeff
6

It is happening to me and turning the source control to none also not works. 

Microsoft Visual Studio Professional 2019
Version 16.11.17

ReSharper 2022.1.20220601.161736

0

Updating Visual Studio itself worked for me.

0

Thanks everyone for the update. We're trying to figure out what could have changed that the problem started happening so often in recent days.

Tangrui1992, do you remember which VS version you had? What version do you have now?

0

Maria Pleskunina:
Unfortunately I didn't take a note of that. And plus it's not relevant because te refractory stopped working again. After VS update, Resharper Refactoring has only worked one time. I'm now reinstalling everything including the latest version of Resharper, I will keep you updated.

0

Maria Pleskunina

I reinstalled latest Resharper for VS 2019 Version 16.11.17, still no good.

I also uninstalled GIT Extension and GitHub Extension for VS, no good.

I was able to do Tools => Options => Source Control => Plug-in Selection => Current source control plug-in => None and make it work, but trust me nobody would prefer this option.

Please keep us updated on the fix progress, thanks!

 

EDIT: I switched the Current source control plug-in back to "Git", no good again.

Disabled Resharper, and then Visual Studio's own renaming tool works fine. Re-enabled Resharper, refactory tool WORKED FOR ONE TIME and then goes back to error.

Edited by Tangrui1992
0

In my case, issue caused by following condition.

  • Using VS2019
  • Using default Git source code control plugin by VS
  • Using ReSharper
  • Changes in Git pane not contains files that refactoring target.

Workaround:

  • Edit few code before refactoring. (to listing in changes in Git pane)
  • Install and use another Git source code control plugin. (e.g. "Easy Git Integration Tools" in Visual Studio Marketplace)
  • Install and use following extensions that avoiding Git source code control plugin issue.
    https://github.com/turqTanza/GitFeatureFlagAdjusterForRsharp/
     (There may be side effects so at your own risk.)

Related links:

Edited by Tanza
1

I am also experiencing this problem on VS 2019.
It worked for months but suddenly I get this problem.
Restarting VS allowes me to perform ONE refactoring operation (move class to different file) and then it continues showing me this message.

I have GIT in place and there is no way in uninstalling GIT from VS, this is a necessay tool, especially while company enforces this.

Unfortunately this is a big anoyence, since I am used to use this feature a lot. Creating every file manually and copying the code by hand  isn't a pleasure.

The strange thing is that it worked like a charm for... since last year. I did no updates or whatsoever in the last days.

And as mentioned, restarting VS allowes a few operations and then locks up again.

I tried the suggestion to add the resharper cache file to gitignore but without success

 

In addition adding a new class also stopped working.
I get the popup to enter the name and after that nothing happens...
I tried it different times but no success....
This is even more annoying than the read-only problem :(

Edited by Hörnchenmeister
3

Please sign in to leave a comment.

Have more questions?

Submit a request