VS2013在构建/调试时自动注释代码行 [英] VS2013 Automatically comment line of code while build/debug

查看:616
本文介绍了VS2013在构建/调试时自动注释代码行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试找到可以帮助我,但没有什么是好的到目前为止。

I try to find something that could help me but nothing was good so far.

我想知道如果有任何选项来评论一些代码行而我开始构建/调试?

I would like to know if there is any option to comment some lines of code while i start building/debugging?

我不想手动进行(编辑并继续手动不是一个解决方案)。我想告诉VS自动评论指定的代码行,如果我开始构建或调试。

当我在服务器测试应用程序时,我需要这行代码,但是当我在本地,我有让它评论。
希望你了解我的问题,并给我快速解决,谢谢。

I don't want to do it manually ("edit and continue" manually isn't a solution). I want "tell VS" to automatically comment specified line of code if i start to build or debug.
I need this line of code when i am testing app at server, but when i do it locally i have to have it commented. Hope you understand my problem and will give me fast solution, thank you.

我使用VS2013和C#。

I use VS2013 and C#.

推荐答案

=https://msdn.microsoft.com/en-us/library/yt3yck0x.aspx =nofollow>预处理指令有帮助吗?默认情况下,DEBUG指令对Debug配置启用,因此 #if(DEBUG) #endif 之间的任何代码只能在您的Debug配置中执行。

Would preprocessor directives help you? By default the DEBUG directive is enabled for Debug configurations, so any code between #if(DEBUG) and #endif will only be executed in your Debug configuration.

这篇关于VS2013在构建/调试时自动注释代码行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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