Visual Studio different settings for 2015 and 2017 - visual-studio

I have VS2015 and VS2017 installed on my machine but I need to have different settings for them. However every time I change something in VS2015 the same configuration is applied in VS2017 and vice-versa.(Ex: on VS2017 I need to have the tab with 3 spaces and on VS2015 with 4 spaces)
Is there a way to break this?

Go to tools-->Options-->Environment-->Accounts to turn synchronization on or off for different settings categories on that computer.

Related

Changing theme on vs2022 affects vs2019

I installed DarkTheme2019. When I switch to it, it changes my VS2019 theme to "Blue". In VS2019, I switch back to "Dark" and then in VS2022 it goes from "Dark(2019)" to "Dark".
VS2022 at least kept the font change from "Dark(2019).
Is there a way to have the two Visual Studio's not be affected by what the other does?
It's a known issue: https://developercommunity.visualstudio.com/t/visual-studio-2022-setting-the-theme-in-2022-chang/1466144
It's not fixed yet (in Visual Studio 2022 version 17.1.0) regardless of what that page says.
There now (Sept 2022) appears to be a fix for this.
In the current VS 2022 (Version 17.3.4), go to Tools -> Options -> Environment -> Accounts and deselect the option to "Synchronize Visual Studio settings across devices and installs on this machine..."
Unchecking this option enabled me to have a theme for VS2022 different from the theme for VS2019.

Instances of Visual Studio with different settings

I want to run two instances of Visual studio having different settings, one having bigger fonts.
How do I do that?
When I run the second instance of vs with
devenv.exe /ResetSettings other.vssettings
that settings affects all running instances of Visual Studio (they seem to poll for changed settings).
You can start Visual Studio with a different "Root Suffix" this will read all the settings from a different registry tree and folder from disk:
devenv.exe /RootSuffix OtherInstanceName
This will give you a new "vanilla" configured Visual Studio instance. Any extensions need to be installed into that instance as well. To install Resharper, use the following steps:
To install to an experimental instance, run the ReSharper unified installer, select the Options button, and enter the name of the instance. The experimental instance does not need to exist before starting the install
https://www.jetbrains.com/help/resharper/sdk/Extensions/Deployment/LocalInstallation/ExperimentalInstance.html
In Visual Studio 2017 this became a bit easier. There you can create completely separate instances from the installer.

How to choose Visual Studio solution Platform Toolset for maximum compatibility

Background
I am open sourcing a few old Visual Studio applications I created a while back. I have created new solutions using my new VS2012 environment for them and have gotten the projects set up as git repositories. I got everything working fine in Visual Studio 2012 with no changes to the source code, all I needed to do was make sure I was linking the proper libraries in the new project configurations.
I would like to configure these projects as to have maximum compatibility for others downloading the project from Github. On this machine I have VS2010 installed alongside the latest VS2012 version. After I got everything working right for both of the projects in VS2012, I tried to open them up in VS2010.
When I tried to build I got a single error:
Specified platform toolset (v110) is not installed or invalid.
Please make sure that a supported PlatformToolset value is selected.
C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Platforms\Win32\Microsoft.Cpp.Win32.Targets 518
What I Tried
So I opened up the properties for the project, went to Configuration Options --> General and the Platform Toolset was indeed set to Visual Studio 2012 (v110). This input is a drop down box and the v110 value is not listed, instead I get two choices:
v100
v90
These correspond to VS2010 and VS2008 respectively. If I change the value to v100 and rebuild I get no errors and my program runs just fine in my Visual Studio 2010 environment.
When I open the project back up in Visual Studio 2012, if tells me that I have an old project file and asks if I want to upgrade, I say yes and it upgrades. I rebuild and run to make sure everything is still working. When I open the configuration options in VS2012 the Platform Toolset is set back to `Visual Studio 2012 (v110) but clicking the drop down input there are several more choices listed:
Visual Studio 2012 (v110)
v110_wp80
Visual Studio 2012 - Windows XP (v110_xp)
Visual Studio 2010 (v100)
Visual Studio 2008 (v90)
‹inherit from parent or project defaults›
My Questions
This has led me to several questions. I am going to pose them all. It would be nice to get as much information as I can, but a good answer to just one of them would probably solve my problem.
If I'm not using features specific to newer versions of Visual Studio, is it possible to set up a solution which can be opened and run without modification in as many versions as possible (ie. 2008, 2010, or 2012)? If so, how?
If I set the Platform Toolset to v90 (VS2008) from within Visual Studio 2012, and it's able to build and run, does this mean that it will build and run for users with VS2012, VS2010, and VS2008?
What exactly does the <inherit for parent or project defaults> option do? What would the project defaults be set up as? Can this be used to tell Visual Studio to try to using whichever installed Platform Toolset will work.
Are there any other options besides Platform Toolset in Visual Studio that I can set to increase compatibility with others' development environments?
This is a somewhat tricky situation. One of the underlying problems here is that VS2010 and VS2012 use MSBuild to build C++ projects, but VS2008 farmed it out to VCBuild instead. You can see this by comparing the project files. VS2010/VS2012 use .vcxproj, while VS2008 uses .vcproj.
If I'm not using features specific to newer versions of Visual Studio,
is it possible to set up a solution which can be opened and run
without modification in as many versions as possible (ie. 2008, 2010,
or 2012)? If so, how?
For maximum compatibility, you want to target the lowest common denominator (i.e. vc90 in this case). Note that when you do the upgrade, the solution file and project files get upgraded to the latest version, which may break compatibility with older versions of Visual Studio.
If I set the Platform Toolset to v90 (VS2008) from within Visual
Studio 2012, and it's able to build and run, does this mean that it
will build and run for users with VS2012, VS2010, and VS2008?
Not really, due to the .vcxproj / .vcproj conflict stated above.
For example, I currently have a set of .vcxproj files and a solution designed for VS2010. I use VS2012 as my IDE, so when I open the VS2010 solution in VS2012, I choose to NOT upgrade it and simply open it as is. VS2012 and beyond should be backwards compatible back to VS2010 as far as project files go.
For maximum compatibility in development environments, my recommendation would be use VS2010's solution as the baseline, targeting v100. Developers can use any version newer than that and it should all work together gracefully.

Visual Studio not closing curled bracket

For some reason, on a new computer, Visual Studio won't auto-close curled brackets.
if(Username.Text.Equals()) {
And it doesn't auto-close. Works perfectly on all other machines I've installed VS2010 on. And now it just won't.
And there doesn't seem to be a setting in the options menu to alter this behavior. What do I need to do?
I'm not sure if this is actually built in to vs2010. But you can install the MS Productivity Power Tools (Productivity Power Tools for Visual Studio 2012) Which will give you brace auto completion. this is quite a common add in so maybe the other copies of VS you have tried have it installed??
Visual Studio will auto-format matching pairs of brackets as you type, but I have never seen this on Visual Studio 'out of the box'.
According to this Microsoft Connect entry, it's officially not on VS2010, having been cut due to time priority issues vs time constraints.
However, add ons like the free Microsoft Productivity Power Tools, or the not-so-free JetBrains ReSharper will add this functionality for you. Perhaps you had one of these (or other similar) add-ons installed in the other computers you have previously worked on.

Visual Studio 2010's Build Command: It does nothing

I'm using Visual C# 2010 Express RTM with Windows Phone Developer Tools April CTP Refresh and when I run any Build option, nothing happens. I've deleted the contents of the build output folders and that doesn't do anything. I can't even run the project, because it complains the executable is missing (XNA Game for Windows project). I've tried the project on another computer and it builds just fine. Any ideas?
I'm not sure how this happens, but here's how I fixed it:
Open Build -> Configuration Manager
In the "Platform" column, choose x86 instead of Any CPU
Click close
These exact steps may not work for you, but I've found that if you play around in the Configuration Manager window it will usually resolve this problem.
try a reinstall?
Visual Studio 2010 doesn't work with current versions of XNA Studio. You'll could wait until XNA Studio 4 comes out (apparently due this month).
To solve your issue, use Visual Studio 2008 or use the workaround at this link to continue using VS2010 and XNA.

Resources