tags:

views:

813

answers:

4

I need to minify some C# code in a handful of Silverlight .cs and .xmal files. What are your tips for maintaining one code base and running a "tool" to generate minified code for a project?

Are there any tools (like Resharper) that will do this? If not fully, partially or assist in some way...

EDIT: I realize that there is no need for C# minification. This is an exercise that I'm doing that does not make sense on the face of it. (This is not homework.)

+1  A: 

Is that necessary? It was my understanding that the compiled .Net assembly would be sent across the wire, not the C# (or whatever language) source code.

Ferruccio
This is probably a question relating to some assignment or contest.
Larsenal
Correct - only needed for this assignment.
Guy
+2  A: 

How about a source-code obfuscator? They generally abbreviate names, etc - and certainly remove white space.

For example, here, with demo here (although you'd probably want to disable the string encoding if possible). Note that this isn't a direct recommendation: this is just the first hit I got for C# code obfuscator.

Marc Gravell
A rule based obfuscator would work - one where you could say "use no more than 2 characters per variable" etc.
Guy
Of course, if you have more variables than the "2 characters per variable" space can hold, you will have problems. (or methods, classes, etc...not just variables)
cdeszaq
A: 

Are you trying to make something for the Silverlight 10k challenge or something? That's why I'm looking for this info...

http://2009.visitmix.com/MIXtify/TenKGallery.aspx