在Mac文件共享/UNC路径上工作时,奇怪的Visual Studio TFS行为 [英] Strange Visual Studio TFS behavior when working on a Mac file share/unc path

查看:150
本文介绍了在Mac文件共享/UNC路径上工作时,奇怪的Visual Studio TFS行为的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Yosemite在Mac上工作.昨天,我安装了Visual Studio 2013 Update 4,并在使用TFS 2013(和TFS作为SCM)时注意到一种奇怪的行为.我的源文件作为本地工作区映射到Mac上的UNC路径.

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.

我试图在Windows中删除只读"标志,并且在源文件夹中做了"chmod -R 777 Source"以允许所有人访问,但这并不能解决问题,只有搁置的解决方法有效.

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.

以管理员身份启动Visual Studio也不能解决问题.

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

还有其他人注意到这种行为或有解决方法的想法吗?

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

推荐答案

我要做的是将本地工作区更改为Visual Studio中的服务器工作区(Parallels上为macOS Sierra + Windows 10);

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

  • 文件>源代码管理>高级>工作区...
  • 在列表中选择您的工作区,然后点击编辑...
  • 高级>>
  • 位置更改为服务器,然后按 OK Close
  • 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:

轻松脱机工作.当您将自己的文件 网络连接不可用或不可靠.从解决方案 资源管理器,您可以在其中添加,编辑,删除,重命名,撤消和比较项目 您的工作区,即使您没有连接到Team Foundation 服务器.

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自动检测更改.添加或删除时 在Visual Studio外部的文件中,程序会自动检测到 这些变化.

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.

我什么时候需要使用服务器工作区?

使用服务器工作区时,Visual Studio仅保留以下内容的一个副本: 每个文件.这样可以大大减少磁盘空间使用并提高 有很多物品时的性能.我们建议您使用 服务器工作空间,如果:

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:

您的工作区包含超过100,000个项目.

Your workspace contains more than 100,000 items.

您要使用Visual Studio 2010或更早版本进行处理 工作区.

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

您需要使用启用最新的结帐功能选项.

困难且性能低下的脱机工作. 在服务器工作区中处于脱机状态,则无法使用本地文件 因为它们是只读的,直到您将它们签出为止.你可以退房 仅从解决方案资源管理器访问文件,并且仅在切换到 离线模式(如下所述).离线时无法 执行任何其他操作,例如添加,删除,重命名或撤消.

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.

这篇关于在Mac文件共享/UNC路径上工作时,奇怪的Visual Studio TFS行为的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆