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

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

问题描述

我正在使用 Yosemite 开发 Mac.昨天我安装了 Visual Studio 2013 的更新 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:

\psfHomeDocumentsMyTFSCustomerprojectSourceCalculationWeightCalculation.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(macOS Sierra + Windows 10 on Parallels)中的服务器工作区

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:

轻松离线工作.您可以快速开始编辑文件网络连接不可用或不可靠.从解决方案您可以在资源管理器中添加、编辑、删除、重命名、撤消和比较项目即使您未连接到 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天全站免登陆