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

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.

Related

How can I set a project-specific environmental variable in Visual Studio?

I need to know whether there is any setting available in "visual studio project setting" to create a environment variable like thing in visual studio 2008 Express edition so that I need not to add into "system variable" for any specific project.
Yes, there most definitely is!
You can configure environment variables for the debugger for an individual project. You'll find the options in your project's Properties window (Alt+F7), under the "Debugging" category.
Fill in the "Environment" property with whatever variables you like.
The screenshot is from VS 2010, but everything looks pretty much the same in VS 2008:
You can also do this with property sheets if you're so inclined or need this for multiple projects.

Change Preferred Language in Visual Studio 2008

When you first install Visual Studio it asks you what your preferred language is and I chose VB. I am now becoming more of a C# guy, but everytime I want to go create a new project. I have to click Other Languages>Visual C#. Is there any way to not have to go through that process. I have seen other people in videos have it like this and I cant seem to find a setting for it. Thanks
Tools -> Import and Export Settings... -> Reset all Settings. Then select C# when asked.
Note that this will likely remove some of your other IDE settings.

How do I change my development environment to a different language in Visual Studio?

When I first installed Visual Studio, I chose to customize my environment for "Visual C++" development. Now, I am working primarily in C# and want to change this setting to a C# environment.
How can I change the environment settings from one language to another in Visual Studio?
Tools → Import and Export Settings → Import Selected Environment Settings...
A dialog will appear, prompting you whether or not you want to save your current settings. If you've made extensive customizations and might want to go back to them at a later date, you should choose to save them.
Then click "Next". You'll be prompted to import a set of environment settings. At the top will be the default environment settings options, customized for each language. In your case, you'd choose C#.
If you wanted to re-import your saved settings, you'd do it the same way—just browse to the saved settings file in the final step of the wizard.
You could also reset all of the settings from the command line:
devenv /resetsettings
And then choose all over again when prompted.
Note: I prefer "General Developer Settings" if you are going to do development in different technology areas (C++, C#, VB, etc.).

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.

How can I point Visual Studio 2008 to a new path for projects?

I didn't see the option to point the workspace (or it's VS equivalent, I'm still learning the terminology for Visual Studio, but it is called a workspace in Eclipse) to My Documents/Programming instead of -- well -- wherever it is now.
What Craig said, plus if you do want to change the default it's in Tools -> Options -> Projects And Solutions.
I've never changed the default and never created a solution/project in the default location, which might tell you something about how relevant it is...
Tools -> Options -> Projects & Solutions.
There is a Visual Studio Projects box.
When you create the project you can specify whatever directory you want, you are not limited to the default.

Resources