简体   繁体   English

混淆后从 Settings.settings 文件中读取

[英]Reading from Settings.settings file After Obfuscation

I've recently obfuscated a DLL using Dotfuscator CE with Visual Studio 2015 Update 3. Here is the Dotfuscator.xml file I used.我最近使用 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>

Now the problem is, the obfuscated assembly contains some information stored in Settings.settings.现在的问题是,混淆后的程序集包含一些存储在 Settings.settings 中的信息。 file, when my code tries to access data from settings file it fails with this following exception.文件,当我的代码尝试从设置文件访问数据时,它会失败并出现以下异常。

The settings property 'ProxyTestURL' was not found未找到设置属性“ProxyTestURL”

Here is the syntax to read setting:这是读取设置的语法:

 Dim strURI As String = My.Settings.ProxyTestURL

I know there is a similar question "Dotfuscator : Error after obfuscation" but it doesn't seems to be either complete or robust, though I put my comments there too but here I would expect a second opinion and more robust solution instead of renaming my settings file literals to obfuscated names(as mentioned there).我知道有一个类似的问题“Dotfuscator : Error after obfuscation”,但它似乎既不完整也不强大,虽然我也把我的评论放在那里,但在这里我希望有第二个意见和更强大的解决方案,而不是重命名我的设置文件文字到混淆名称(如那里所述)。

You should exclude My.Settings from renaming.您应该My.Settings命名中排除My.Settings Instructions for doing so are in the docs .这样做的说明在文档中

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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