4

I suddenly have begun encountering an error similar to "E:\Websites\Stage\mywebsite\somefile.ascx: Access to the path is denied" on a multitude of my local files when attempting to check them in. The files it is failing on are all sorts of files, PNG, ASPX, CONFIG, etc.

I am using Visual Studio 2013 for Web (Update 4) and the visualstudioonline.com TFS.

The files are stored on a network location and I have a drive mapped to that location. I can manually open, manipulate, and save any of the files that error so I do not believe it is truly a permissions issues.

This setup has worked for months but suddenly it is giving me problems.

I ran a powershell script on the folder Get-ChildItem -Include *.* -Recurse -Path 'E:\Websites\Stage' | select fullname,isreadonly and all the files return 'False' under the isreadonly column. No errors are returned.

I am in need of some further ideas.

eat-sleep-code
  • 4,753
  • 13
  • 52
  • 98

3 Answers3

13

I found a workaround in another StackOverflow question.

Essentially, you shelve the pending changes, then you commit it. No need to unshelve them.

I would only suggest to use that to check-in your changes until you set another workspace locally (or someone fixes that issue).

As many other, using Visual Studio 2013 from within a VM having a local workspace located on the host computer mapped through a shared drive was working well before updating to "VS2013 update 4".

That setup was suggested to me with the reasoning that if the VM crashes, then I wouldn't loose my changes.

Community
  • 1
  • 1
Francis
  • 341
  • 2
  • 6
  • 1
    Oddly, this "shelf before check-in" fixes the issue. – eat-sleep-code May 21 '15 at 04:51
  • Exploiting a bug in the software as a workaround does not remove the risk of the activity. This is not a supported model. Use a local disc location. – MrHinsh - Martin Hinshelwood Aug 29 '16 at 01:57
  • 1
    This is still a problem in Visual Studio 2017 (Pro) would you believe, but the same workaround still works - thanks! – Matty J Feb 21 '19 at 03:04
  • After hours of searching, changing permissions (on `Catalina`), the [answer in that linked SO post](https://stackoverflow.com/a/41601755/304683) on changing your `workspace` from `local` to `server` worked for me. Hth. – EdSF Feb 17 '20 at 15:49
4

Storing your local workspace on a network location is not supported and should never be done.

Have a 'local' (physically on your local machine) workspace where you edit the files and check in. Then have an automated build that publishes the files to a location of your choice.

  • 2
    sigh. This is why microsoft products suck so much. In git, a network location is just another location, as it should be – U Avalos Aug 23 '16 at 04:55
  • Server based source control, wither TFVC, Subversion, or Perforce, is not Git and does not execute like Git. Microsoft supports Git in TFS very well. Don't blame the vendor for your choices. – MrHinsh - Martin Hinshelwood Aug 29 '16 at 01:53
2

I ran Windows/Visual Studio in Parallels on a Mac and had a project saved to my desktop (yes, shame on me). Internally this path is handled as \\psf\Home\Desktop even if it is stored locally and not in the network. Still gives the same exception and is solved by moving it to your regular drive (c:\...)

Brandtware
  • 451
  • 4
  • 17
  • That it's still a shared location, which is not supported. Workspaces should be unique to both a Maher and user. Because this looks like a shared location it causes the same error. – MrHinsh - Martin Hinshelwood Aug 29 '16 at 01:54