How to set a default configuration in a Visual Studio Solution File?
Asked Answered
S

3

20

In VS2005 and up, is it possible to specify which configuration should be selected by default?

I have several configurations in my solution but one of them should be used in most cases. Hence I'd like to make sure that devs who pull it out of Source Control use the right configuration(unless of course they specifically choose another one).

Ideally, this setting should be in the .sln file since that one is under Source Control.

Sisal answered 24/10, 2008 at 8:59 Comment(0)
L
18

As far as I understand, if there is no .suo file, first platform in alphabetic order becomes the default configuration.

Latter answered 3/12, 2008 at 22:52 Comment(3)
this is what I experience as well. Which suggests a workaround consisting in renaming the config to make sure it's first in the list.Sisal
In VS 2008, I can confirm it is not alphabetical order. I have "All Debug,All,Boot Loader,Boot,Debug,Driver Debug,Driver x64 Debug,Driver x64,Driver x86 Debug,Driver x86,Driver,Format Debug,Format,Mount Debug,Mount,Release,Setup Debug,Setup" from the .sln file and "Debug" is the default when the .suo file is deleted. See: github.com/CipherShed/CipherShed/blob/v0.7.3.0-dev/src/…Towbin
This looks to still be true for Visual Studio 2017Musty
A
10

This is pretty old, but this was helpful for me:

It by default picks its platform as Mixed Platform. If that doesn't exist, it picks the first listed in your .sln file.

The default configuration is something that starts with Debug. So if you have something called Debug Test, it will select that. If that doesn't exist, it goes by order in your .sln file. It will not pick Test Debug over Debug.

Abracadabra answered 20/7, 2015 at 18:59 Comment(2)
This is beyond annoying, why wouldn't it pick "Any CPU".. thanks for clarifying this!Birdiebirdlike
Yes. I agree. It's actually kinda baffling there's no setting to do this automatically.Abracadabra
L
1

I don't know if I understand the complete situation behind your question, but there is a way to "externalize" some of VS.Net's project configuration values such as FxCop settings into a separate file. Then you could have all projects in a solution point to that file. However, I don't think it would allow for your devs to chose their own configuration after doing the "externalization"

If this seems like the right path for you, check out these posts from me in regards to coding standards on how to make similar changes for configuration.

Labyrinth answered 23/11, 2008 at 22:57 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.