有没有办法抑制VS试图上线?
如果已配置解决方案与 TFS 的绑定,则当您打开解决方案时,VS 会询问您:
---------------------------
Microsoft Visual Studio
---------------------------
Go Online
This solution is offline but its associated Team Foundation Server is available.
Would you like to go online with this solution after it has loaded?
---------------------------
Yes No Help
---------------------------
或者,如果 TFS 不可用,它会建议您选择暂时脱机工作或完全删除绑定。
有没有办法抑制这些对话框?
给你一些背景信息。我们团队的一部分直接使用 TFS,其他部分则通过 git-tfs 工作。使用 git-tfs 时 - 我根本不需要在线模式。因此,每次我打开解决方案或在解决方案中重新加载项目时,我都应该一遍又一遍地回答相同的问题。但我无法删除绑定,因为直接使用 TFS 的人员将失去无缝连接到 TFS 的能力。
If there's configured binding of the solution with TFS, when you opening a solution VS asks you:
---------------------------
Microsoft Visual Studio
---------------------------
Go Online
This solution is offline but its associated Team Foundation Server is available.
Would you like to go online with this solution after it has loaded?
---------------------------
Yes No Help
---------------------------
Or alternatively if TFS is not available it proposed the choice to work temporarily offline or remove bindings at all.
Is there a way to suppress these dialogs?
To give you some context. Part of our team is working with TFS directly and other part is working via git-tfs. When working with git-tfs - I don't need online mode at all. So every time I open a solution or reload a project in the solution - I should answer the same things, over and over again. But I couldn't delete bindings as then the people working with TFS directly will lose ability to connect to TFS seamlessly.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
tfpt 中的connections 命令(2008 tfpt 中为tweakui)是否能满足您的需求?你可以将服务器(实际上是2010年的集合)标记为VS离线。
巴克
Does the connections command in tfpt (it was tweakui in the 2008 tfpt) accomplish what you need? You can mark the server (actually the collection in 2010) as offline for VS.
Buck
VS 2012 不显示此对话框,而是写入一些信息来输出有关 TFS 不可用的信息,这是可以接受的。
对于 VS 2010 和 VS 2008,最令人恼火的是,有时每个项目都会显示此对话框,即,如果解决方案中有 30 个项目 - 您必须在每个解决方案打开时单击“确定”30 次。对于这些,我可能假设一个部分解决方案 - 在解决方案的根文件夹中创建一个名为“ProjectConfiguration.xml”的文件,其中包含以下内容:
然后,在每个 *.csproj 文件中,删除所有 SccXxx 元素并添加此行(作为第一个- 级 XML 节点,不在
PropertyGroup
中):之后 VS 仅触发该对话框一次。此外,如果您像我一样正在使用 git,则可以发出 git update-index --assume-unchanged 'ProjectConfigurations.xml' 并注释这些行而不提交它们(
assume-未更改
基本上命令 git 忽略更改,即使文件已被跟踪 - 此处是此选项的简要说明)。PS 我们还在这些文件中包含了一些其他选项,例如
true
- 它由 VS 和 MSbuild 完美处理。VS 2012 doesn't show this dialog, but rather writing some info to output about unavailability of TFS, which is acceptable.
For VS 2010 and VS 2008 the most irritating thing is that sometimes this dialog showed for each project, i.e. if you have 30 project in solution - you have to click 'OK' 30 times at each solution opening. For these I may suppose a partial solution - create a file named "ProjectConfiguration.xml" in the root folder of your solution with this content:
Then, in each *.csproj file, remove all SccXxx elements and add this line (as a first-level XML node, not in the
PropertyGroup
):<Import Project="$(SolutionDir)ProjectConfigurations.xml" />
After that VS fires the dialog just one time. Moreover, if you, like me, are working with git, you can issue
git update-index --assume-unchanged 'ProjectConfigurations.xml'
and comment these lines without committing them (assume-unchanged
basically commands git to ignore changes even if file is tracked already - here is brief description of this option).P.S. We also included in these file some other option as well, e.g.
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
- it is handled by both VS and MSbuild perfectly.我不知道如何抑制这些对话框,但您始终可以对解决方案文件进行更改以删除绑定,而无需将其签入以影响其他开发人员。我知道当本地编辑(未签出)文件发生很大变化时,这有时会很烦人,但解决方案文件可能不是这种情况。
I don't know a way to suppress these dialogs but you can always make the changes to the solution file to remove the bindings without checking it in to affect other developers. I know this is sometimes annoying when the locally edited (not checked out) file is changed a lot, but that's probably not the case for the solution file.
就我而言,我所做的是在文本编辑器中打开 sln 文件,然后查找“GlobalSection(TeamFoundationVersionControl)”并将该部分一直删除到相应的“EndGlobalSection”行。 (不是最后一个,而是第一个 GlobalSection(TeamFoundationVersionControl) 行之后的一个)
然后我重新加载了解决方案,它不再要求连接到 TFS(我们没有……它被承包商使用)我们雇用了他们,并且我们获得了带有 TFS 信息的源代码)。
这是一件轻而易举的事。
In my case, what I did was to open up the sln file in a text editor, and looked for "GlobalSection(TeamFoundationVersionControl)" and deleted the section all the way to the corresponding "EndGlobalSection" line. (not the last one, but the one after the first GlobalSection(TeamFoundationVersionControl) line)
I then re-loaded the solution and it no longer asks to connect to TFS (which we do not have... it was used by a contractor house that we hired, and we got the source code with the TFS information).
It was a breeze.