views:

79

answers:

2

Hello every one :)

I'm trying to reduce as much as I can my VB.Net assembly side, and I just figured out that all variable names were kept unchanged in the actual assembly. Since I tend to use pretty long var names, it adds up and, by running dotfuscator on my assembly, I could shrink it by as much as 10%.

Thus I wonder: is there any way to tell Visual Studio to use shorter var names in the generated assembly? Are there any downsides to using dotfuscator (I'd rated avoid it though, since it'd need to be called after every compilation, therefore forcing me to update my build scripts...)?

Thanks a lot, CFP.

A: 

You could buy a .NET Obsfucator that does compression:

http://www.xenocode.com/Obfuscator/

Nissan Fan
In fact, I just need the vars renaming part, I use a 7z compression anyway.
CFP
A: 

No. It's actually not safe to change names without any guidance. Renaming can break code, especially if you're using Reflection.

Visual Studio always goes for safety. If you want to re-name your variables, you could add obfuscation to the build scripts to have them automatically redone each build.

That being said, once the assembly is compiled at runtime by the JIT, it won't matter. The only advantages of obfuscating and using shorter names are a slightly smaller assembly, which may (slightly) improve your load times, but shouldn't matter much for runtime.

Reed Copsey
Thanks! It's not about performance actually, but rather about reducing the server load. Plus, I have very strict limitations on the eventual assembly size... I guess I'll make do until I really have no other solution but to use obfuscating :)
CFP