tags:

views:

199

answers:

5

Is there any tool that cleans up C#.NET code of all the comments, debug statements, documentation when deploying it to a server?

I am looking to use this for deployment scenarios...and hopefully should be able to integrate this with CruiseControl.NET or even TFSBuild.

Thanks in advance.

  • SK
+7  A: 

There is no reason to do this. Comments, debug statements, and documentation are ignored by the compiler, so if you're deploying using MS-Build, there is no point to this.

David Stratton
+3  A: 

Do a release build - that will remove all of those things.

Andrew Hare
+5  A: 

Comments: They are ignored by default

debug statement: As long as you compile your code in release mode, all the Debug.Assert are ignored.

documentation : same with comments

Ngu Soon Hui
+1 for clarifying.
David Stratton
A: 

Release Build - nt

eglasius
+1  A: 

When your code is 'built' the compiler will generate a binary image CLI instructions. No commets will be present, they are ignored.

To remove debug statements, build in release mode.

If you are worried about people reversing your code, you should consider obfuscation to make it more difficult.

TJB
+1 although obfuscation will only make it more difficult, but not that much so.
David Stratton
Yeah, obfuscation is a female dog, especially when you're doing reflection and/or implementing services with named endpoints etc. bleh
TJB