Multiple Visual Studio (2012) profiles (addons + settings) - visual-studio

I use Visual Studio 2012 for both C# and C++ development. I also use different extensions depending on the current working project: ReSharper for C# and Visual Assist X for C++.
Is there a way of creating multiple Visual Studio profiles (or installations of the same version) that will use a specific (and different) set of extensions? Currently I have to deactivate/reactivate some manually and it's getting annoying that such a feature doesn't exist (at least something like Eclipse's workspace)
Combine this with different environment setting (e.g.: tabs and spaces settings) for each project and you'll soon get mad. I know we can use different settings files, but it's still annoying to have to re-import a specific .vssettings file each time you open a different project.
Thanks.

Have you considered "Run As" for Visual Studio and use another Windows User Account? That should allow you to disable R# and VisualAssist separately.
There used to be a way to run a Macro to import an exported settings file, but they removed the Macro functionality in VS2012 (sadly). You could write an extension that manages importing different settings I guess.

Related

Per solution new line options for braces in Visual Studio 2017

Through this answer to a question on per-solution indentation settings for Visual Studio I found out that the EditorConfig format is supported for VS 2017.
What I cannot find is how to use EditorConfig (or failing that: any alternative) to set "New line options for braces" on a per-solution basis.
Here's the relevant settings from Visual Studio:
These settings are persisted on my Visual Studio 2017 account, which is really annoying since I use defaults for my pet projects, but the project I mainly work on uses Egyptian braces style. If I change these settings on my work PC they will be synched to my home PC every time, and vice versa.
Can EditorConfig be used to have per-solution settings for "New line options for braces"? Failing that, is there another way to handle this?
I believe these are controlled by the csharp_new_line_before_open_brace property in .editorconfig. Unfortunately the closest thing I have seen to documentation on the properties used by roslyn is the source code and the issue under which they were added.
My experience with getting visual studio to use a .editorconfig file however, has been a bit hit and miss. Sometimes visual studio will ignore the file without giving any reason.

Auto disable specific extension when launch visual studio?

I want to configure different extensions for different projects, for example, enable visual assist for c++ projects, but disable it for c# projects.
I try to export two vssetting files, and run "devenv.exe /Resetting 1.vssetting" or "devenv.exe /Resetting 2.vssetting", but it fails to retain extensions status.
Any one helps me? Thanks very much
One hacky method is to modify the ExtensionManager\EnabledExtensions list in the registry. For example, for Visual Assist in VS 2015 its registry entry is like this (name is a fixed guid plus version number, path is random):
[HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\14.0\ExtensionManager\EnabledExtensions]
"44630d46-96b5-488c-8df926e21db8c1a3,10.9.2102.0"="C:\\Users\\sv\\AppData\\Local\\Microsoft\\VisualStudio\\14.0\\Extensions\\w1vivolz.4tz\\"
If you remove this entry, Visual Assist becomes disabled. Put it back and it is enabled again.

Visual Studio 2015 Find in Files not remembering file types or locations

I rely on the Find in Files dialog in Visual Studio a great deal. (Sometimes Intellisense/Resharper just don't cut it.) Since upgrading to 2015, I've noticed that the dialog doesn't remember my custom "Look in" paths or "Look at these file types" lists between sessions.
If I close my solution and VS instance, then reopen, I have to enter my custom path and file types again. Huge waste of time. Has anyone run else run into this? Any workaround? 2013 used to remember this stuff.
Microsoft Visual Studio Professional 2015
Version 14.0.23107.0 D14REL
Microsoft .NET Framework
Version 4.6.00081
Installed Version: Professional
I've never had any problems with it not remembering my settings, but I imagine that you could run a custom registry modifier to add the appropriate keys, you could make sure your settings are always pristine. The custom search information is stored in HKEY_CURRENT_USER\SOFTWARE\Microsoft\VisualStudio\14.0\Find.
The file types are stored in a string key called Filter with whatever you would normally input into the custom file type category in the VS search window. For example searching for only .cs and .txt files you would put *.cs;*.txt.
The folders are located in a string key called Query with values such as C:\Folder1;C:\Folder2. However, it's behavior seems a little weird. You have change the value of Query and a Query+integer value (i.e. Query0) to the same value to have it appear in Visual Studio.
If you just run a script to modify the above values to the files types/folder locations you want, that should work.
I ran into this today. After much searching I found a post on the visual studio forums somehow. This pointed me towards ReSharper. This directed me towards a workaround.
Start visual studio in safe mode with the command line argument /SafeMode
Create the folder sets you want for searching
Restart visual studio not in safemode
Once I had restarted all my created custom searches remained, and the registry values were created. This might not work in the specific case, but this worked for me.
You can set these values programmatically inside Visual Studio for the Find and Replace dialog (for example with Visual Commander):
DTE.Find.FilesOfType = "*.txt";
DTE.Find.SearchPath = #"c:\temp";
If you have an earlier version of VS, export the environment settings, copy the NumberOfScopes and NamedScopes* settings from the Environment_UnifiedFind section to the same section in your VS2015 settings file and then re-import settings.
Once I did this, it allowed VS2015 to start saving folder specifications for future settings exports.
Or you could try replacing this in your VS2015 export:
<PropertyValue name="NumberOfScopes">0</PropertyValue>
With this:
<PropertyValue name="NumberOfScopes">1</PropertyValue>
<PropertyValue name="NamedScopes>0">FOLDER_SPEC_NAME>SEMICOLON_SEPARATED_LIST_OF_FOLDERS>{4A812F3C-7B1A-4987-9769-461F20EB25CB}</PropertyValue>
(Don't forget to re-import after you make the change)

Developing multiple Visual Studio 2010 extensions

Im working on a couple of independent Visual Studio extensions in separate solutions. When I open one of them and launch the experimental instance in the debugger, the other extensions from the other solutions (which aren't open) are loaded as well. There must be a way to only launch one extension in the experimental instance at a time (in particular the one you're currently working on), right?
You can actually create as many experimental instances as you like by using different, arbitrary values of the "RootSuffix" parameter (which will create multiple separate base keys in the registry) but I'm not sure how easy it is to configure VSSDK projects (such as VsPackage ones) to publish to a different VS hive. Probably just a property you set inside each project file. Each experimental instance is completely separate.
So you can run "devenv.exe /RootSuffix MyFirstInstance" and "devenv.exe /RootSuffix MySecondInstance" and each will use separate sets of user extensions. This would result in using the registry keys HKCU\Software\Microsoft\VisualStudio\10.0MyFirstInstance_Config and HKCU\Software\Microsoft\VisualStudio\10.0MySecondInstance_Config, respectively.
They seem to have removed a lot of the documentation for this feature since VS2005, but it all still seems to work.
Not really. When you build and run the extension project in VS, it is actually deployed to the experimental instance of VS, but they're not uninstalled when you finish debugging/running.
Your best bet is to use the script to reset the experiment instance that is provided with the VS SDK. Unfortunately you'll have to do this every time you switch between your solutions.
Look in the start menu for:
Microsoft Visual Studio 2010 SDK\Tools\Reset the Microsoft Visual Studio 2010 Experimental instance.lnk

Visual Studio: Profiles for addins

I would like to be able to switch between using Visual Studio with C#-addins (Resharper, TestDriven.Net and VisualSVN) and C++-addins (Visual Assist X and VisualSVN). I have found that Resharper and Visual Assist X does not coexist very well and I would like an easy way to change between them.
Anyone know how to do that? If I can have different key-bindings for each profile, that would be a big plus - as would the ability to have different instances of Visual Studio running in different profiles.
Virtual machines would do it of course, but that seems overkill.
Maybe to record two macros: one that starts the C# add-ins and stops the C++ add-ins, and the other doing the oposite? Then run one of the macros after starting IDE?
Add .cs to the Extensions to ignore list in the VA Options dialog (Projects | File Handling) - but also report problems you are experiencing to Whole Tomato

Resources