Is there a way to suppress VS trying to go online?
Asked Answered
K

4

6

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.

Kosel answered 21/7, 2011 at 17:55 Comment(0)
K
1

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.

Kosel answered 19/8, 2012 at 22:32 Comment(0)
O
1

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

enter image description here

Ofori answered 27/9, 2011 at 20:22 Comment(0)
K
1

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.

Kosel answered 19/8, 2012 at 22:32 Comment(0)
T
0

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.

Thinner answered 22/7, 2011 at 1:11 Comment(2)
Not only solutions are affected. Every project has bindings. And moreover, git wouldn't ignore changed files if they are already have been tracked even if they listed in .gitignore (at least I don't know a way to do so).Kosel
Not to mention even if you succeeded, git wouldn't pickup your intended changes to project/solution files going forward.Fluent
M
0

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.

Mccammon answered 26/12, 2012 at 22:32 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.