c# - 混淆后从 Settings.settings 文件读取

标签 c# obfuscation dotfuscator

我最近使用 Dotfuscator CE 和 Visual Studio 2015 Update 3 混淆了一个 DLL。这是我使用的 Dotfuscator.xml 文件。

<?xml version="1.0" encoding="utf-8" standalone="no"?>
<!DOCTYPE dotfuscator SYSTEM "http://www.preemptive.com/dotfuscator/dtd/dotfuscator_v2.3.dtd">
<dotfuscator version="2.3">
  <propertylist>
    <property name="SourceDirectory" value="This Path Will Be Replaced By Visual Studio" />
    <property name="SourceFile" value="This Filename Will Be Replaced By Visual Studio" />
  </propertylist>
  <input>
    <asmlist>
      <inputassembly>
        <option>library</option>
        <file dir="${SourceDirectory}\" name="${SourceFile}" />
      </inputassembly>
    </asmlist>
  </input>
  <output>
    <file dir="${SourceDirectory}\" />
  </output>
</dotfuscator>

现在的问题是,混淆后的程序集包含一些存储在 Settings.settings 中的信息。文件,当我的代码尝试访问设置文件中的数据时,它失败并出现以下异常。

The settings property 'ProxyTestURL' was not found

这里是读取设置的语法:

 Dim strURI As String = My.Settings.ProxyTestURL

我知道有一个类似的问题“Dotfuscator:混淆后出错”,但它似乎既不完整也不稳健,尽管我也把我的评论放在那里但在这里我希望得到第二意见和更稳健的解决方案将我的设置文件文字重命名为混淆名称(如那里所述)。

最佳答案

您应该从重命名中排除 My.Settings。这样做的说明在 the docs 中。 .

关于c# - 混淆后从 Settings.settings 文件读取,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42222308/

相关文章:

c# - 运行程序集的 .NET 调度程序?

.net - 在 .Net DataSets 上使用列名或列索引更好吗?

xna - 适用于 WinPhone 7 和 XNA 的 Dotfuscator

c# - 是否可以在单独的类中移动层次结构的流畅配置?

c# HttpWebResponse Header 编码

c# - 当 WPF 应用程序最大化时,UI 经常挂起

jakarta-ee - 如何防止JavaEE 6 .war文件的反向工程?

c# - 使用 Dotfuscator 进行 XML 序列化

.net - 如何让 Dotfuscator 从命令行工作?