Tuesday, April 25, 2006

Visual Studio 2005 and C++ Directories

I have been playing with Visual Studio 2005. Don't call me "laggard", I am from "Late Majority" :-) The good news for skeptics like me was that 2005 coexists nicely with 2003. The bad news it is doesn't bring much for C++ developers. Well, sometimes no news is a good news.

Among other things, I checked how VC 8.0 stores C++ global settings.

Why do I care to know? I need to switch between two C++ projects. One of them is a huge legacy application that relies heavily on global Visual C++ directories. So every time I switch I have to go to Menu Tools Options Projects VC++ Directories, change Includes, change Libs, build, and when I'm done, change them all back for the current project. Doesn't look very tempting, eh? The standard workaround is using command line build and environment variables, which is fine for a build, not so good for debugging. My old favorite trick has been swapping Visual Studio global settings.

VS 6.0 was using registry to store them. Easy: just deal with .reg files.
In Visual Studio .NET 2003 it is a bit more complex: the registry key is still there: [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\7.1\VC\VC_OBJECTS_PLATFORM_INFO\Win32\Directories]. However, it contains only *default* settings. When you modify paths in Tools Options Projects VC++ Directories, this information is not persisted in the registry. Instead they are stored in your user application data directory. Look up VCComponents.dat at %USERPROFILE%\Local Settings\Application Data\Microsoft\VisualStudio\7.1\.

Visual Studio 2005 treats it exactly as 2003, except it is 8.0 instead of 7.1.

So whenever you want to save settings, distribute them to project members, or easily switch between different projects, deal with VCComponents.dat files. Make sure you don't have .NET running when swapping the files.

AddThis Social Bookmark Button

4 Comments:

At 4/30/2006 11:18:00 AM , Blogger Deb said...

Hi Dimitri. Did you know that the Conchango Scrum plug-in for VS2005 is out, and free (apparently)? I've heard it's much better than the MS so-called Agile toolkit. The authors are CSMs in the UK.

 
At 10/21/2008 04:32:00 AM , Anonymous chandru said...

VCComponents.dat is not at all present.. Not only the folder you have mentioned, its nowhere in the system! are u sure that its VCComponents.dat?

 
At 10/25/2008 12:44:00 AM , Blogger Dmitri Zimin(e) said...

Chandru,
If you haven't change defaults it may not be there, I think it only gets created when settings are edited.
DZ.

 
At 11/13/2008 02:30:00 AM , Blogger chandru said...

Hi DZ,
I found the settings in a file called, CurrentSettings.vssettings. Its present in My Documents\Visual Studio 2005\Settings.

-Chandru

 

Post a Comment

<< Home