【问题标题】:WPF threw exception after using dotfuscator?使用dotfuscator后WPF抛出异常?
【发布时间】:2014-01-22 09:27:20
【问题描述】:

我正在使用 dotfuscator 4.12 在我的应用程序中加密 exe 和 dll!

但在加密之后,我运行我的应用程序并因跟随调用堆栈而崩溃

Set connectionId threw an exception./n Stack Trace =    at System.Windows.Markup.WpfXamlLoader.Load(XamlReader xamlReader, IXamlObjectWriterFactory writerFactory, Boolean skipJournaledProperties, Object rootObject, XamlObjectWriterSettings settings, Uri baseUri)

at System.Windows.Markup.WpfXamlLoader.LoadBaml(XamlReader xamlReader, Boolean skipJournaledProperties, Object rootObject, XamlAccessLevel accessLevel, Uri baseUri)

at System.Windows.Markup.XamlReader.LoadBaml(Stream stream, ParserContext parserContext, Object parent, Boolean closeStream)

at System.Windows.Application.LoadComponent(Object component, Uri resourceLocator)

at DVRServerInterface.MainWindow.InitializeComponent()

at DVRServerInterface.MainWindow..ctor()

我的应用程序使用 WPF,它有 13 个项目,包括 C++ 和 C# 项目,它们都使用 .Net Framework 4.0。并且我在使用 dotfuscator 时检查了所有加密选项。

有人可以帮我解决吗?

非常感谢,

T&T

【问题讨论】:

    标签: c# c++ .net wpf dotfuscator


    【解决方案1】:

    我怀疑它是由 Dotfuscator 引起的。

    确保您已将所有依赖项\引用放在正确的位置。通常,当您收到“设置 connectionId 引发异常”异常时,您还会有一个 InnerException 应该告诉您缺少哪些引用。

    当你捕捉到异常时,记录 InnerException 的详细信息:

    try
    {
    }
    catch(Exception ex)
    {
      //ex.InnerException.Message and other exception details are accessible here, so just log them somewhere to see what's going on, but it can be null too so check for that first
    }
    

    【讨论】:

    • 谢谢!但是如何捕捉 InnerException?
    • 它是你捕获的正常异常的一个属性(称为 InnerException)
    • 我已经修改了我的答案以显示如何获取 InnerException 详细信息
    • 谢谢!我会尽快让你知道结果:)
    【解决方案2】:

    嗯,应用程序在混淆后停止正常工作是很常见的。

    如果您使用的是混淆器,那么您希望尽可能多地混淆代码,但有时您不得不禁用混淆器中的某些选项,这很不幸。

    通常,当外部团队遇到此类问题时,我们会使用二分搜索来查找问题)))

    我们关闭混淆器工具中的一半复选框,然后尝试启动它并在程序的同一步骤中捕获异常。 这个过程一直持续到您了解哪个模块上的哪个选项会导致效果。大多数情况下,这种行为的原因是自我修剪或混淆。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2010-12-13
      • 2013-05-24
      • 1970-01-01
      • 2021-05-13
      • 1970-01-01
      • 2016-07-21
      相关资源
      最近更新 更多