Change the Background theme of Visual studio depending on environment (ie DEV, TEST & LIVE) - visual-studio

Does anyone know how to change the background colour of Visual Studio depending on the environment settings or parameter settings?
I am trying to make it so I can automatically see which environment my SSIS package is running in when I open the package, by the colour theme.
Any pointers into the right direction would be appreciated.

Related

Using visual studio 2019 in dark mode with high contrast in Windows 10

Is there anyone who is using Visual studio 2019 in dark mode with High contrast?
If yes, can you tell me exactly how to do that?
As far as I know, Visual studio doesn't have an option to use High contrast for dark mode (it's there only for blue theme which I don't want).
And also if I change my Windows OS to use high contrast mode and come back to Visual studio, and then by default VS adjusts itself to high contrast but it's very poor to read (it reads like plain white text on a black blackground devoid of any other colors)
I was wondering if there's something in VS 2019 which is similar to Visual studio code high contrast mode or maybe IntelliJ Idea which is very user friendly and serves the purpose.
Thanks in advance.
You can enable dark mode in the VS2019 by modifying a private registry in a next way:
Close all instances of VS2019
Press Ctrl+R and run regedit
Expand HKEY_USERS elements in the tree
File -> Load Hive...
In the dialog navigate to C:\Users\<UserName>\AppData\Local\Microsoft\VisualStudio\16.0_XXXXXXXX and load privateregistry.bin file. It will ask you to give some name, for example, "vs2019". (it might be useful to store somewhere a copy of privateregistry.bin file for backup)
Export te “Dark” theme registry key: HKEY_USERS\vs2019\Software\Microsoft\VisualStudio\16.0_????????_Config\Themes\{1ded0138-47ce-435e-84ef-9ec1f439b749}
Replace the GUID of the “Dark” theme ({1ded0138-47ce-435e-84ef-9ec1f439b749}) with the GUID of the “High Contrast” theme ({a5c004b4-2d4b-494e-bf01-45fc492522c7})
Import the reg file
Important: Click on vs2019 -> File -> Unload Hive...
Note, it might happen after Windows or VS updates, your setting will be erased. In this case, you need only to load hive, import modified file from step 7, and don't forget to unload hive.
Inspired by this post: Visual studio 2017 high contrast theme dark registry hack
Visual Studio likes resetting this pretty often so I made a cmd script that lets you select what theme to override 'High Contrast' with instead of doing all of those steps manually each time.
Get the script here.
The most clean way is to modify the current used theme as this is the behaviour Visual Studio executes when changing themes in the settings.
Close all instances of Visual Studio 2019 / 2022
Press Ctlr+R and run regedit
In the node tree, expand HKEY_USERS
Press File -> Load Hive...
In the dialog navigate to C:\Users\<UserName>\AppData\Local\Microsoft\VisualStudio\16.0_XXXXXXXX or if you use Visual Studio 2022 C:\Users\<UserName>\AppData\Local\Microsoft\VisualStudio\17.0_XXXXXXXX and load the privateregistry.bin file. It will ask you to give some name, for example, "vs2019". (before proceeding a backup of the privateregistry.bin file is advised)
Navigate to HKEY_USERS\vs20xx\Software\Microsoft\VisualStudio\1x.0_xxxxxxxx\ApplicationPrivateSettings\Microsoft\VisualStudio
There, set the value of ColorTheme and ColorThemeNew to 0*System.String*1ded0138-47ce-435e-84ef-9ec1f439b749 and 0*System.String*{1ded0138-47ce-435e-84ef-9ec1f439b749} respectively. If you wish any other color please check HKEY_USERS\vs20xx\Software\Microsoft\VisualStudio\1x.0_????????_Config\Themes\ for the theme IDs.
Click on the loaded node in the node tree named vs20xx and then File -> Unload Hive...
This will change the setting in Visual Studio to use a different theme instead of changing the themes themselves and will most likely be persistent after updates.

Change dark blue background in Visual Studio 2010 IDE

The dark blue background in the Visual Studio 2010 IDE is driving me nuts. How can I change the background to a slate silver color?
You can do that in Tools / Options and then Environment / Fonts And Colors and there is a setting for background color.
Or even better you can choose from predefined styles at http://studiostyl.es/, these style setting works for Visual Studio 2008 and Visual Studio 2010 for all versions, including the express :
http://weblogs.asp.net/scottgu/archive/2010/04/29/download-and-share-visual-studio-color-schemes.aspx
I use this one:
http://visualstudiogallery.msdn.microsoft.com/20cd93a2-c435-4d00-a797-499f16402378?SRC=VSIDE
It will add a 'Theme' menu to the tool bar where you can change the colour scheme to a pre-set one, or define your own.
there is a site called https://studiostyl.es it contains a some of nice themes
download a theme you like
then go to tools>options>Environment>import and export setting
then you will see a textbox for team setting file
finally, put the path of your downloaded setting file, then press ok

Can I have VS2010 change the environment settings based on the project loaded?

see title
For example: Open a C++ project, it opens using the C++ environment settings or an arbitrary environment settings file. Then open a C# project and then it opens using the C# environment settings or an arbitrary environment settings file.
Or should I honestly not care and just use the interface I already set up? What advantages would there really be for switching them per project/project type?
Maybe Perspectives extension can help you. After installing you can save your current layout as perspective (just like in Eclipse) in Visual Studio 2010.

VS2010 Macro To Change Environment Settings Based on Build Configuration

I want to change my environment colors when I switch from "Debug" to "Release" configuration in Visual Studio 2010. I want it to really stand out that I have changed a configuration. Is there an event I can handle with a Visual Studio macro to find out when the configuration dropdown has changed? Also, can anyone point me to the object where I change the VS environment's colors? Thanks.

How to Export/Import Toolbars in Visual Studio

I export my settings in Visual Studio and if I ever move to a new machine or have problems, I use those backed up settings to restore Visual Studio to the way I like it. It also allows me to maintain a consistent development environment between the various machines that I use.
This works great for keybindings, syntax highlighting, user tools, pretty much everything except for the toolbar locations and customizations. Whenever I move to a new machine and restore the settings, the toolbars are not affected. I have spent a fair amount of time setting up toolbars with my macros, external tools, etc and cut'n'pasted icons in for them. I hate losing all that work.
Does anybody know how to back up and restore the toolbars' locations and customizations? If it is not a feature of Visual Studio, is there an addin that will do the job?
Edit
As mentioned below, the Menu and Command Bar Customizations in Import and Export Settings is supposed to do this, but when I re-import my previous settings, I get
Error 1: Menu and Command Bar Customizations: The version of command bar settings being imported is not supported. All the command bar settings have been ignored.
The settings I am trying to re-import were exported earlier this month with the same version of Visual Studio. The only difference is that I am now running 64 bit as opposed to x86. I didn't think that would make a difference though since the settings files are XML.
Any ideas?
I have finally found the solution to this. There is a known bug in Visual Studio and there are two workarounds given. The first workaround does not apply, but the second worked.
To Backup your toolbars:
Copy the file CmdUI.PRF from the path %AppData%\Microsoft\VisualStudio\X.Y\1033 to the same directory as your exported .settings file.
where X.Y is either of 8.0, 9.0, 10.0 or 11.0 depending on your visual studio version (2005, 2008, 2010 and 2012 respectively).
To Restore your toolbars:
Make sure Visual Studio is closed and copy the backed up file back to the original location.
For the benefit of others, as you mentioned this feature doesn't seem to be supported across versions of Visual Studio, presumably because of a change in the DTD/XSD for the settings file? At any rate, here's where the settings for your custom toolbars lie in the "Import and Export Settings..." dialog:
Note: Your options may look different, depending on the settings you exported.
I have not tried it, but "Tools\Import and Export Settings..." maybe will let you export a .vssettings file you can then take to another box.
See also
http://blogs.msdn.com/saraford/archive/2005/04/19/409887.aspx
and other Sara 'export' tips.

Resources