Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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 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.

like image 467
Ivan Danilov Avatar asked Jul 21 '11 17:07

Ivan Danilov


2 Answers

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

like image 195
Buck Hodges Avatar answered Nov 14 '22 20:11

Buck Hodges


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.

like image 30
Ivan Danilov Avatar answered Nov 14 '22 21:11

Ivan Danilov