简体   繁体   中英

Rename Visual Studio Solution Configurations?

I have a VB project which I'm trying to configure with three build configurations.

I've successfully created the build configurations, but I decided the names I was using weren't descriptive enough so I went to Configuration Manager -> <Edit...> -> Rename and renamed them.

This renamed the configurations in the Configuration Manager.

I then went to do some conditional compilation testing using #If CONFIG = but it failed.

Checking deeper, it turns out that the values returned by CONFIG are the original names not the new names.

Checking My Project -> Compile -> Configuration I can see that the names shown in that ComboBox are also the old names.

So, even though I have "renamed" my configurations in Configuration Manager, they're not being renamed on all levels.

I can get around this by recreating these configurations with their intended names but that's about as bass ackwards a solution as I can think of. Is there some method of renaming configurations that actually works or is this just the way MS intended this to... "work"?

I think you have renamed only the Solution Configuration and not the individual Project Configuration.

Reopen the Configuration Manager and check, on every project line, the name of the configuration.
By the way, I agree with you. MS could have done better here.

For example, when you create a new solution configuration, you have the option to create the corresponding configuration on the projects. When you rename a configuration this option is missing. It's an inconsistency from MS

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM