重命名 Visual Studio 解决方案配置? [英] Rename Visual Studio Solution Configurations?

查看:28
本文介绍了重命名 Visual Studio 解决方案配置?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个 VB 项目,我正在尝试使用三种构建配置对其进行配置.

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

我已经成功创建了构建配置,但我认为我使用的名称不够描述,所以我去了 Configuration Manager -> <Edit...> -> Rename 并重命名它们.

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.

然后我使用 #If CONFIG = 进行了一些条件编译测试,但失败了.

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

进一步检查,结果是CONFIG返回的值是原始名称,而不是新名称.

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

Checking My Project -> Compile -> Configuration 我可以看到 ComboBox 中显示的名称也是 em> 旧名称.

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

因此,即使我在 Configuration Manager 中重命名"了我的配置,它们也不会在所有级别上都被重命名.

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

我可以通过使用它们的预期名称重新创建这些配置来解决这个问题,但这几乎是我能想到的解决方案.是否有一些重命名配置的方法实际上有效,或者这只是 MS 打算...工作"的方式?

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.

重新打开配置管理器并检查每个项目行上的配置名称.
顺便说一下,我同意你的看法.MS 可以在这里做得更好.

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.

例如,当您创建新的解决方案配置时,您可以选择在项目上创建相应的配置.当您重命名配置时,此选项将丢失.这是来自 MS 的不一致

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

这篇关于重命名 Visual Studio 解决方案配置?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆