Only get certain items in TFS Visual Studio - visual-studio-2012

I am using Team Foundation Server, plugged-in to Visual Studio 2012.
We have a wide range of projects and solutions, but rarely need everything on our local machines.
Is there a way using Team Explorer to get latest only on certain solutions in different folders, in bulk, using a single click (or as close as possible)?
Development
Project 1 Get this
Project 2 Ignore this
Project 3 Get this
Framework
Project 1 Ignore this
Project 2 Get this
...in one click.

For this type of thing, I use tf.exe in a command file on my desktop. That way I just have to double-click the .cmd file. It has the added bonus of being a lot quicker than firing up VS.
#ECHO OFF
SET DEVENVPATH2013=C:\Program Files\Microsoft Visual Studio 12.0\Common7\IDE
Echo Getting latest files...
REM Navigate to to Solution's mapped folder on local machine, e.g. for me it is D:\Socrates\Development, and issue a get against the relevant TFS folder for the Solution ($/Socrates/DEVELOPMENT)
D:
CD \Socrates\Development
"%DEVENVPATH2013%\tf.exe" get $/Socrates/DEVELOPMENT /recursive
REM Copy the above 3 lines for each separate Solution you want to Get Latest for
Echo Finished.
Echo.
BTW, I'm guessing that you will need to edit the DEVENVPATH to be 11.0 instead of 12.0
So for your example, and assuming your local folder mappings are directly under C drive, you will want something like:
#ECHO OFF
SET DEVENVPATH2012=C:\Program Files\Microsoft Visual Studio 11.0\Common7\IDE
Echo Getting latest files...
REM Navigate to to Solution's mapped folder on local machine, e.g. for me it is D:\Socrates\Development, and issue a get against the relevant TFS folder for the Solution ($/Socrates/DEVELOPMENT)
C:
CD \Development\Project1
"%DEVENVPATH2012%\tf.exe" get $/Development/Project1 /recursive
C:
CD \Development\Project3
"%DEVENVPATH2012%\tf.exe" get $/Development/Project3 /recursive
C:
CD \Framework\Project2
"%DEVENVPATH2012%\tf.exe" get $/Framework/Project2 /recursive
Echo Finished.
Echo.

If you setup a workspace that points at the root of the folder structure that you b have listed and in the workspace cloak the folders that you do not want you can simply get latest on the workspace in a single command in the UI and it gets what you want.
https://msdn.microsoft.com/en-us/library/gg490753.aspx

There's two things you can do
Get a portion of the directory structure by opening Source Control Explorer, right clicking a node in the folder tree and selecting "Get Latest Version" from the context menu. This will get the selected folder and all sub-folders.
Open a Visual Studio solution directly from source control. Double click the SLN file in Source Control Explorer. Visual Studio will get all the items referenced by the solution and its projects. You can then get latest on just the solution items by right clicking the top of the solution tree in Solution Explorer and selecting "Get Latest Version (Recursive)" from the context menu.

Related

Find in Entire Solution in Visual Studio 2012 gets quite a lot of result from Temp folder

In Visual Studio 2012, I tried to do some search in:
Find in Files->Entire Solution, then I get quite a lot results from files in
C:\Uses\myusername\AppData\Local\Temp\
. The files take the name like tmpE11.tmp.cs or tmpFBEE.tmp.cpp, the contents are identical to some of the files in my solution.
My guess is that it is caused or auto-generated by some crashes, but why are they reachable by the search? I doubt if I can simply delete them or not.
Maybe this is related to a bug reported, where lots of tmp files created and are then included in the Find Results. If I clear the 'Miscellaneous Files Folder' the search does not include the temporary files.
To display the 'Miscellaneous Files Folder' (see https://msdn.microsoft.com/en-us/library/36bhtx7w.aspx):
List item
On the Tools menu, click Options.
In the Options dialog box, expand the Environment node and select Documents.
Select Show miscellaneous files in Solution Explorer.
Specify the number of documents you want to appear in the folder.
In Visual Studio 2013 you can limit the contents to 0 which effectively prevent inclusion.

Change where Visual Studio default settings on startup?

I like to keep my folders quite organised, and don't like the default Visual Studio folder in my documents. It seems like it should be rather simple to point VS to my own custom folders for most of its settings, which I have done. The only problem is, on start up, VS keeps looking for a settings file (*.vssettings file) in a (non-existent) default folder which I can't seem to find any option to change (c:\users\renzo\documents\visual studio 2013\settings), making the IDE revert to most recent settings (the custom settings file I have created in a nice separate folder... which is fine, but accompanied by an annoying error message). If I so much as touch the tools-options menu (literally, without changing anything) VS then creates a new folder (in that same annoying default location!) storing my current settings! The cycle repeats!
Is there anyway to change where VS looks for these default *.vssettings files, and stop creating this new irritating "CurrentSettings.vssettings" file!?
Might seem a bit nit-picky, but its really getting under my skin!
Thanks,
Renzo
Use mklink to change directory or file location to what you want. Choose one of the commands below.
mklink /d d:\VisualStudio c:\users\renzo\documents\visual studio 2013
mklink /d d:\VisualStudioSettings c:\users\renzo\documents\visual studio 2013\settings
mklink d:\VisualStudioSettings\CurrentSettings.vssettings "d:\VisualStudioSettings c:\users\renzo\documents\visual studio 2013\settings\CurrentSettings.vssettings"

How to force Visual Studio not to add GlobalSection(Performance) section?

I played with Visual Studio builtin profiling tools and now every time I check out any file this section automatically adds to my solution file:
GlobalSection(Performance) = preSolution
HasPerformanceSessions = true
EndGlobalSection
I totally removed all profiling reports, then removed local copy of all source control files from this solution and update to latest. This section still in *.sln file after any checkout.
Other teammates who haven't used prfiler doesn't have this problem.
Has anyone any ideas?
Open the PerformanceExplorer in Visual Studio by using the Menu Analyze -> Windows -> PerformanceExplorer and check if it lists any session entries.
If so delete them by doing a right-click on an entry to open the ContextMenu. Then select "Remove" from the menu.
You should also check the folder of your solution if it contains any .vsp or .psess files and delete them. These are the report files of a profiling session.
Only way I could solve this was to close the solution, delete *.psess and *.vsp files from the root directory, reset my .sln file to the remote version and reopen the solution. Problem was then gone. This was using Visual Studio 2015 Community Edition.

Change "Visual Studio 2010" folder location

I would like to change the "Visual Studio 2010" folders location to my Dropbox folder, so it gets synced every time I make a change. I have searched on the internet, but haven't found a solution yet.
Is it possible to change the "Visual Studio 2010" folders location from within Visual Studio 2010, specifically Visual C# Express 2010?
If you want to relocate everything in the Visual Studio 2010 folder, it takes a couple steps:
In Visual Studio, go to Tools > Options > Projects and Settings > General. Set the three locations as desired.
In Registry Editor, navigate to HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\10.0. Set the remaining locations that still reference Documents\Visual Studio 2010 as desired.
Tools > Options > Projects and Solutions > General > "Projects location" setting. Change the others too if you routinely create templates.
As stated by the other answers, some of the paths are configurable (settings, default projects location, and the user template locations) and can be set under Tools->Options. However, it is important to note that the actual registry value that determines the root path is at HKCU\Software\Microsoft\VisualStudio\12.0\VisualStudioLocation, and that this value is only taken into account if HKCU\Software\Microsoft\VisualStudio\12.0\MyDocumentsLocation is set correctly.
To change these registry keys properly:
Make sure Visual Studio is not running.
Open the registry editor and first make sure that HKCU\Software\Microsoft\VisualStudio\12.0\MyDocumentsLocation is set to your actual My Documents location (this is very important, otherwise some of the other paths in the registry will take on default values on the next open/close cycle) and does not have a trailing slash. If this registry value is not there, you must add it.
Change the HKCU\Software\Microsoft\VisualStudio\12.0\VisualStudioLocation to whatever path you'd like the files to be stored at.
(Optional, but recommended) Search for more references to the old path in the registry under both 12.0 and 12.0_Config and update them accordingly.
Note that if you ever change the location of My Documents in Windows, several of the paths (including VisualStudioLocation, which most of the others are based on) will revert to their defaults, and you'll have to follow the steps above again.
(Modify the Visual Studio version number as applicable -- 12.0 is for VS2013, 11.0 for VS2012, etc.)
HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\12.0\NewProjectDialog\MRUSettingsVenusProjectLocationEntries
HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\12.0\NewProjectDialog\MRUSettingsLocalProjectLocationEntries
if above solution doesnt work try this ones.
From Tools Option> projects and Solution as show down
In case someone come across this question these days, in VS2017 Community there is a "Location" node under Tools-> Options-> Projects and Solutions-> Locations. The fields are no longer under "General".

What sort of resharper specific files does resharper generate in your vs.net project?

What sort of resharper specific files does resharper generate in your vs.net project?
(BTW, did you guys get the full version or just the C# version?)
The "_Resharper.[Solution Name]" folder stores the Resharper specific cache. You can go to Resahrper > Options dialog and select "Store caches in: system TEMP folder" so that your solution folder is not cluttered.
I personally prefer to use the TEMP folder so that the cache does not accidentally get added to the version control. Also, in case you want to clean the cache you can use the "Clear Caches" button on the Resharper Options dialog.
Couple of different things:
A folder called "_ReSharper.[Solution Name]" which then contains a collection of files and folder beneath that
A file called "[Solution Name].[ReSharper Version].resharper.user"
Both are created in the root of solution next to the .sln file. You can delete them if necessary and ReSharper will just recreate them on next load. Keep them out of your source control management system - they serve no purpose under verison control.

Resources