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

If when configuring the binding of a solution with TFS when 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, otherwise, if TFS is not available, it is suggested to choose to temporarily disable the work or remove the bindings altogether.

Is there any way to suppress these dialogs?

To give you some context. Part of our team works with TFS directly, while another part works through git-tfs. When working with git-tfs - I do not need online mode. Therefore, every time I open a solution or reload a project in a solution, I have to answer the same things again and again. But I could not remove the bindings, as people working with TFS directly will lose their ability to easily connect to TFS.

+6
source share
4 answers

VS 2012 does not show this dialog, but rather writes some information to conclude that TFS is unavailable, which is acceptable.

For VS 2010 and VS 2008, the most annoying is that sometimes this dialog was shown for each project, that is, if you have 30 projects in the solution, you need to click "OK" 30 times each time you open the solution. To do this, I can assume a partial solution - create a file called "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, delete all SccXxx elements and add this line (as the first level XML node code, not in the PropertyGroup ): <Import Project="$(SolutionDir)ProjectConfigurations.xml" /> After that VS starts dialogue only once. Moreover, if you, like me, work with git, you can release git update-index --assume-unchanged 'ProjectConfigurations.xml' and comment on these lines without commenting on them ( assume-unchanged basically git commands ignore changes, even if the file is already being tracked - here is a brief description of this option).

PS We also included one more option in this file, for example, <TreatWarningsAsErrors>true</TreatWarningsAsErrors> - it is perfectly handled by both VS and MSbuild.

+1
source

Does the connections command in tfpt (it was twaakui in 2008 tfpt) does what you need? You can mark the server (actually a collection in 2010) as offline for VS.

Tank

enter image description here

+1
source

I don’t know a way to suppress these dialogs, but you can always make changes to the solution file to remove the bindings without checking it, to affect other developers. I know this is sometimes annoying when a locally edited (unverified) file is badly modified, but probably not the case for the solution file.

0
source

In my case, I decided to open the sln file in a text editor and looked for "GlobalSection (TeamFoundationVersionControl)" and deleted the section to the corresponding line "EndGlobalSection". (not the last, but one after the first line of GlobalSection (TeamFoundationVersionControl))

Then I reloaded the solution and it no longer wants to connect to TFS (which we don’t have ... it was used in the house of the contractor we hired and we got the source code with TFS information).

It was a gentle breeze.

0
source

Source: https://habr.com/ru/post/893297/


All Articles