Strange Visual Studio TFS behavior when working on a Mac file share/unc path
Asked Answered
C

1

8

I'm working on a Mac with Yosemite. Yesterday I installed Update 4 of Visual Studio 2013 and noticed a strange behavior when working with TFS 2013 (and TFS as SCM). My source files are mapped to a UNC path on my Mac as a local workspace.

When I do changes to my files and try to check-in I get the following message:

\\psf\Home\Documents\My\TFS\Customerproject\Source\Calculation\WeightCalculation.cs: Access to the path is denied.

When I shelve my changes and unshelve them, I can check-in the file. I can reproduce this on every file, when I get the message "access denied".

Update I just played with it a bit and: I don't need to unshelve the files. It's enough to shelve them and check "preserve pending changes locally". After that, I can check-in.

I tried to remove the "read-only" flag in Windows and I did `chmod -R 777 Source" on the source folder to allow access from everyone. But this does not solve the problem. Only the shelve workaround works.

Starting Visual Studio as administrator does not solve the problem either.

Anyone else noticed this behavior or has an idea how to solve it?

Cota answered 24/11, 2014 at 18:19 Comment(5)
Have you tried using a Local workspace which doesn't set the read-only flag?Selfmade
Yes, it is a local workspace. I will add this information to the question. I just checked it again: It was some other file which had read only, and not the source filesCota
My experience is that putting your local workspace on a networkshare is a bad practice. They're not called "local" workspaces without reason :).Fahey
@Fahey Yes, maybe I have to remap them. :( But it's still confusing that it works when shelving the files before.Cota
I also have this problem using Visual Studio on a Windows VM under VirtualBox on a Windows host using a shared folder on my host. I had to do this so I can connect to a VPN on my VM and check in files, while keeping my host machine free to modify code in another editor with full access to our internal network. The only purpose my VM serves is to host Visual Studio to work with TFS and it's a pain in the ass.Totalitarianism
N
4

What I did was to change the local workspace to a server workspace in Visual Studio (macOS Sierra + Windows 10 on Parallels);

  • File > Source Control > Advanced > Workspaces...
  • Select your workspace in the list and hit Edit...
  • Hit Advanced >>
  • Change Location to Server and hit OK and Close

Now you should be able to check in without needing to shelve.


Note that there are some differences between a local and server workspace, but in my case it works just fine with a server workspace;

Why should I use a local workspace?

When you use a local workspace, you get the following advantages:

Work offline easily. You can quickly begin editing a file when your network connection is unavailable or unreliable. From Solution Explorer you can add, edit, delete, rename, undo, and compare items in your workspace even when you're not connected to your Team Foundation Server.

Easily restore files that you have deleted locally. To restore locally deleted files, just get your files.

Visual Studio automatically detects changes. When you add or delete files outside of Visual Studio, the program automatically detects these changes.

Important: One drawback to using a local workspace is that performance degrades as the number of items increases. See the next section for details.

When might I need to use a server workspace?

When you use a server workspace, Visual Studio keeps only one copy of each file. This can significantly reduce disk space usage and improve performance when you have a lot of items. We recommend that you use a server workspace if:

Your workspace contains more than 100,000 items.

You want to use Visual Studio 2010 or earlier versions to work with the workspace.

You need to use the Enable get latest on check-out option.

Work offline with difficulty and with poor performance. When you are offline in a server workspace, you cannot work with your local files because they are read-only until you check them out. You can check out files only from Solution Explorer, and only after you switch to offline mode (as explained below). While you're offline, you can't perform any other operations, such as add, delete, rename, or undo.

Tip: You can improve responsiveness by enabling asynchronous checkout. For more information, see Manage team project collection workspace settings for your team.

Nullipore answered 11/1, 2017 at 22:19 Comment(1)
After hours of searching, changing permissions (Catalina) and such, this solved my the issue. Thank you.Boldfaced

© 2022 - 2024 — McMap. All rights reserved.