简体   繁体   中英

How to prevent renaming of all classes, interface in dotfuscator

I am following a MSDN site https://msdn.microsoft.com/en-us/library/hh977082(v=vs.107).aspx for obfuscating my c# code using the dotfuscator that comes free with VS.

In my C# projects, I have used Dependency Injection (Castle.Windsor) so my application crashed after the obfuscation.

I am thinking about not renaming any of my classes and interface name including constructors but let their methods, variables rename would solve the problem. I am trying to set the exclusion rule for this in the dotfuscator but still not able to do so.

Could you please let us know how to set the exclusion rule that prevent renaming of classes and interface names along with its constructors but let their methods and variable get renamed in dotfuscator? I am using the dotfuscator that comes with VS2015.

The Renaming documentation for Dotfuscator Community Edition gives general instructions for how to do renaming exclusions like this. It sounds like, in this case, you should add a Type exclusion. That will just exclude the types themselves (and their constructors) without excluding any methods/fields/properties. Type exclusions also apply to interfaces.

If you're trying to exclude all types and interfaces, you can mark the exclusion rule as a regular expression rule, and just use .* to match all names. If you're trying to exclude just a subset of types, be careful to specify fully qualified names.

You can use the Preview button to see what will be excluded. (Note that the constructors won't show as being excluded, but they will actually be excluded when you build.)

Finally, the Pro documentation for excluding by Type has more detail about how some of these features work, so it might help to look there, too. For the most part, the feature is the same between Pro and Community.

Full disclosure: I work for PreEmptive Solutions.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM