Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I export ALL my Visual Studio 2012 font and color settings?

I've installed VS2012 at home and would like to import all my work settings.

When I export my fonts and colors from my work station the .vsssettings file that is produced only has 5 or 6 items in it.

On my work station, I installed a Studio Styles color theme then tweaked it, so my work station is anything but the VS2012 defaults.

I suspect that installing a Studio Styles theme overrides the Visual Studio default values with new default values, and the Visual Studio export function only exports non-default values.

Question: Is there a way to export ALL my Visual Studio fonts & color settings?

like image 259
YeeHaw1234 Avatar asked Jul 12 '13 12:07

YeeHaw1234


2 Answers

Go to Tools and select Import and Export Settings, then follow the wizard to export your settings.
In the Tree View deselect all the options except for All Settings -> Options -> Environment -> Fonts And Colors

like image 104
Steve Avatar answered Sep 22 '22 11:09

Steve


Sometime something go wrong in the configuration of Visual Studio 2012 (it just happened to me) and what happen is that when you export all the setting, the fonts and colors WONT get exported.
So I've discovered the hard way that the last 2 years of VS2012 cfg backup are useless, because they didn't contains any information about fonts/colors.

Luckily I have 3 of 4 year worth of VS cfg backup, and I extracted the fonts/colors cfg form a file 2 years old.

I've been able to restore a working VS with the following process

  • Reset VS config
  • Import the last cfg backup (which included everything but fonts/colors)
  • Export only Fonts/colors from VS (it wil creare a nearly empty file)
  • Copy/paste the correct fonts/color from the last backup that contained them to the just exported empty fonts/colors file
  • reimport the now filled fonts/colors cfg file

So, lesson learned, I searched the whole HDD to find out where the currente settings are (look for the CurrentSettings.vssettings file) and I setted up a scheduled job to create a daily copy of this file.

I suppose that the CurrentSettings.vssettings will always hold the fonts/colors config... but I suppose I won't know until VS mess up the configuration again.

Here is the batch file I sue to do the backup, save it in a file like "DoVScfgBackup.cmd" and place it in the CurrentSettings.vssettings
You will need to create a "Backup" folder in the CurrentSettings.vssettings folder.
Then schedule DoVScfgBackup.cmd for daily execution.

@echo off
rem  Finding the script pathset scriptPath=%~dp0
set scriptPath=%~dp0
set scriptPath=%scriptPath:~0,-1%


set dt=%date:/=_%
set tm=%time::=_%
set tm=%tm:,=_%


set nomefile=CurrentSettings.vssettings


fc /a /b "%scriptPath%\%nomefile%" "%scriptPath%\Backup\%nomefile%_last" >nul

IF ERRORLEVEL 1 (
    copy "%scriptPath%\%nomefile%" "%scriptPath%\Backup\%nomefile%_last"  >nul
    copy "%scriptPath%\%nomefile%" "%scriptPath%\Backup\%nomefile% %dt% %tm%"  >nul
)
like image 32
Max Avatar answered Sep 21 '22 11:09

Max