如何防止重命名所有類,dotfuscator 中的接口 (How to prevent renaming of all classes, interface in dotfuscator)


問題描述

如何防止重命名所有類,dotfuscator 中的接口 (How to prevent renaming of all classes, interface in dotfuscator)

我正在關注 MSDN 站點 https:/ /msdn.microsoft.com/en‑us/library/hh977082(v=vs.107).aspx 使用 VS 免費提供的 dotfuscator 混淆我的 c# 代碼。

在我的C# 項目,我使用了依賴注入 (Castle.Windsor),所以我的應用程序在混淆後崩潰了。

我正在考慮不重命名我的任何類和接口名稱,包括構造函數,但讓它們的方法、變量重命名會解決問題。我試圖在 dotfuscator 中為此設置排除規則,但仍然無法這樣做。

您能否告訴我們如何設置排除規則以防止重命名類和接口名稱及其構造函數,但讓它們的方法和變量在 dotfuscator 中重命名?我使用的是 VS2015 自帶的 dotfuscator。


參考解法

方法 1:

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.

(by PrakashNathan Arthur)

參考文件

  1. How to prevent renaming of all classes, interface in dotfuscator (CC BY‑SA 2.5/3.0/4.0)

#dotfuscator #c#-4.0 #obfuscation #C#






相關問題

如何在構建中自動化 Dotfuscator (How to automate Dotfuscator in build)

Dotfuscator 命令行 (Dotfuscator command line)

Dotfuscator có vẻ như không tuân theo việc đổi tên RegEx (Dotfuscator Seems Not Adhering To Renaming Exclusion RegEx)

如何使用 dotfuscator 合併多個本地化文件? (How can I use dotfuscator to merge multiple localization files?)

在混淆的 Windows 應用商店應用程序中,包含公共調試符號是否有任何危險? (In an obfuscated Windows Store App, is there any danger in including the Public Debug Symbols?)

無法加載混淆程序集 (Cannot load obfuscated assembly)

混淆 .NET Microsoft Office 插件的工具 (Tools that Obfuscate .NET Microsoft Office Add-in)

Dotfuscator 社區版 (Dotfuscator community edition)

Dotfuscator 構建後事件退出,代碼 1 (Dotfuscator Post-Build Event Exited With Code 1)

如何防止重命名所有類,dotfuscator 中的接口 (How to prevent renaming of all classes, interface in dotfuscator)







留言討論