如何检查运行时使用的Visual Studio的活动解决方案配置? [英] How do I check the active solution configuration Visual Studio built with at runtime?

查看:145
本文介绍了如何检查运行时使用的Visual Studio的活动解决方案配置?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想基于我在Visual Studio中添加的自定义解决方案配置来启用/禁用某些代码.如何在运行时检查此值?

I would like to enable/disable some code based on a custom solution configuration I added in Visual Studio. How do I check this value at runtime?

推荐答案

您可以使用 precompiler指令. #if指令可让您根据自定义解决方案配置来确定是否要包含代码.

You can use precompiler directives within Visual Studio. The #if directive will allow you to determine if you are going to include code or not based on your custom solution configuration.

这篇关于如何检查运行时使用的Visual Studio的活动解决方案配置?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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