由于共享冲突而无法打开文件

由于共享冲突而无法打开文件

本文介绍了错误VSP1737:由于共享冲突而无法打开文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用Team Foundation Server(TFS)运行性能和诊断会话时,Visual Studio 2013 Ultimate中出现错误.下面是重现步骤:

I am getting below error in the Visual Studio 2013 Ultimate when running performance and diagnostics session with Team Foundation Server (TFS). Below are the steps to reproduce:

  1. 从Team Foundation Server获取最新信息.
  2. 创建"CPU采样"方法的新性能会话.
  3. 启动新创建的性能会议.
  4. 通过关闭Internet Explorer或单击退出退出会话后在停止分析"上.
  1. Get latest from Team Foundation Server.
  2. Create new Performance Session of "CPU Sampling" method.
  3. Launch the newly created Performance Session.
  4. After exiting the session by closing internet explorer or clickingon "Stop Profiling".

然后我将在输出"窗口中得到以下错误消息.

Then I would get below error in the Output Window.

Preparing web server for profiling.
Profiling started.
Launching web server with profiling.
Launching profilable project.
Profiling process ID 9460 (iisexpress).
Profiling process ID 7008 (iexplore).
Process ID 7008 has exited.
Process ID 9460 has exited.
Error VSP1737: File could not be opened due to sharing violation: C:\Users\%hiddenuserprofile%\Documents\Projects\%HiddenPathWithFilename%.vsp
PRF0025: No data was collected.
Profiling complete.

为了摆脱此错误,我将必须清除TFS设置的解决方案文件夹的只读属性.如果我清除了只读属性,那么TFS将无法检测到TFS服务器在本地工作区中所做的更改.然后,我将不得不使用TFS中的compare选项手动检查更改,然后合并.

In order to get rid of this error, I would have to clear the read-only attribute of my solution folder which TFS has set. If I clear the read-only attribute then the TFS cannot detect changes in my local workspace with the TFS server. Then I would have to manually check for changes with compare option in TFS and then merge.

为什么会显示此错误?我做对了吗?

Why does this error shows up? Am I doing it the right way?

推荐答案

发生此错误的原因是,您已将不应在其中的文件添加到源代码管理中.因此,它是从TFS下载的,并标记为只读.

This error occurs because you have added files to source control that should not be in there. Therefore it is downloaded from TFS and marked as read only.

您应该使用.tfignore文件.您将必须手动删除所有已添加的文件.开始时,您应该没有任何/bin/*或/obj/*文件.

You should use a .tfignore file. You will have to manually remove all of the files that have already been added. You should not have any /bin/* or /obj/* files for a start...

然后检查* .dll和其他二进制文件,包括* .vsp文件,并将其从源代码管理中删除.

Then check for *.dll and other binaries, including *.vsp files and remove them from source control.

二进制文件有两种类型:

There are two types of binaries:

  1. 参考-应该使用Nuget进行,并且绝不包含在源代码管理中或手动添加.
  2. 输出/已生成-不应将任何已生成的文件添加到源代码管理中.
  1. References - these should be done using Nuget and never included in source control or added manually.
  2. output/generated - No generated files should be added to source control.

这篇关于错误VSP1737:由于共享冲突而无法打开文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-24 19:04