views:

170

answers:

2

I realize this is a rather odd request, but I was wondering if anyone was aware of some minification/obfuscation tools that work on C# source code (not a compiled assembly). I am trying to reduce the character count of an already written application to meet a character limit and I can't seem to find any tools that will help me achieve this task.

Main features I am interested in:

  • Strip Whitespace
  • Shorten Variable Names

It doesn't have to be a full on obfuscator, just something that will reduce the character count of a block of code quickly and conveniently.

This is not intended to have any practical or real world application, it's for a competition.

A: 

I think this is a pretty much a duplicate of http://stackoverflow.com/questions/350705/do-you-have-any-tips-for-c-minification

olle
it might help if you tell us why not.
olle
I looked at this post prior to posting and it did not adequately answer my question.
Nathan Taylor
The link he provided pointed to a website with no download link anywhere I could find. I proceeded on the path to find a similar obfuscation tool and none of them work on the source code level. They all modify an assembly to provide some custom interpretation of the code. Not what I am looking for.
Nathan Taylor
+2  A: 

I am not aware of any such tool, but it would not be too hard to do some variable renaming using the built in refactor tools in Visual Studio.

For the whitespace, a regex find-replace, to replace any multiple spaces (:Wh+ in VS replace) with a single space.

benPearce
Fair enough. That works for me.
Nathan Taylor