Question

I have a Visual Studio 2013 solution that is under source control (TFS, Visual Studio Online). It is mapped to a local workspace, I have checked out some files (e.g. web.config, global.asax).

When I try to save any changes to files I get a 'Save File As' dialog, and if I hit Save it warns me the file already exists (say, web.config), and asks me if I want to replace it. If I hit Yes I get I get an error dialog saying 'the process cannot access the file '....\wyfvmjia.p1p~' because it is used by another process. I have no idea what this file is or how it is related to the file (web.config) I am trying to save.

This is infuriating, any help would be greatly appreciated!

EDIT 1:

It looks like the Visual Studio process (devenv.exe) is creating and deleting random temporary files in the same folder (e.g. wyfvmjia.p1p~) and is causing a 'sharing violation' on those files (I used a sys internals utility to monitor the folder) when I am trying to save let's say web.config.

EDIT 2:

This seems to suggest in one of the comments that VS2013 creates a copy of a file and then replaces the original when trying to save a file in your project. This would explain why I see temporary files getting created and deleted. It's odd I get the 'Save File As' dialog though. It looks like some other process (antivirus?) gets hold of the temporary file before VS can do something with it?

EDIT 3:

I created a console application project with only a program.cs file and the same is happening. This may be a problem with Antivirus software interfering with the VS2013 'copy-replace' feature.

EDIT 4:

Changed title. Still have not been able to find a solution.

EDIT 5:

See the accepted answer. Apologies for not getting back earlier.

Was it helpful?

Solution 4

It turns out this was caused by disk encryption software. Disabling the disk encryption software services each time after starting VS2013 solves the problem. I did not have this problem with earlier versions of Visual Studio, presumably because of the new copy-replace cycle adopted by VS2013 mentioned in EDIT 2 in my original question.

Apologies for not coming back to comment and answer my original question, I completely forgot about it.

OTHER TIPS

For me it was Google Drive. Once I've closed it, I was able to save the file.

Try running Visual Studio as Administrator.

Extensions might be the problem. Or you could be opening some readonly files. It's worth to mention that some of the extensions can turn any file you create in to a readonly file, and this would be the same result that you're facing.

So first, disable all extensions, and check for the little icon near the files's name (in the tab) that indicates a readonly file.

I had the same problem and it was caused by "Backup and Sync from Google". After I’ve closed it everything went back to normal.

I had this problem as well. It went away once I uninstalled VS 2013 and installed VS 2012 instead. Good enough for me.

I had the exact problem on a company computer. I had to uninstall VS 2013 RC2 and reinstall vs2013 ultimate. Then I had to go through the update process for update 1. I believe it must by the Symantec progressive scan along with the VS 2013 upgrade handling of files. I guess the moral of the story, if I can be so cliché is "If it aint broke don't fix it".

I had the same issue and created a bug on Connect. Let's hope this gets fixed

https://connect.microsoft.com/VisualStudio/feedback/details/860265/unable-to-save-files-in-vs-2013-update-2-rc2

I got mine fixed by making a copy of all the files with git clone then deleting all old files and pasting the copied versions over it. Not sure how this fixed permissions or an antivirus denying permission but it did

martijn_himself sounds correct, problem could be because of Disk Encryption Software. This problem started om my PC when i changed settings (domain etc) on Disk Encryption Software. and a simple "Update 2" for VS2013 fixed this issue.

I had the same problem with only one html file in a project. For me it seems to have something to do with VPN that I was using to upload this html file to CRM system. Whenever it was on it seemed to "block" the file somehow. When I closed the window where I was uploading the html file I can save without any issues.

I tried all the suggestions here but none worked. Then, with the modified file open in Visual Studio, I navigated to the file on disk and deleted it. Then clicked build and the save file dialog no longer popped up. I was able to build and check in.

For me, it was Windows' Controlled Folder Access, even though I didn't get the standard warning/error. In "Allow an app through...", I had to add

C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\WDExpress.exe

(Backup and Sync from Google) when I close it The problem vanished

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top