开发者

Is there a way to suppress VS trying to go online?

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 tim开发者_Go百科e 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.


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

Is there a way to suppress VS trying to go online?


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:

<?xml version="1.0" encoding="utf-8"?>
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="4.0">
  <PropertyGroup>
    <SccProjectName>SAK</SccProjectName>
    <SccLocalPath>SAK</SccLocalPath>
    <SccAuxPath>SAK</SccAuxPath>
    <SccProvider>SAK</SccProvider>
  </PropertyGroup>
</Project>

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.


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜