1

我正在使用 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 时检查了所有加密选项。

有人可以帮我解决它吗?

非常感谢,

电通

4

2 回答 2

0

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

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

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

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

于 2014-01-29T16:10:53.753 回答
0

我怀疑它是由 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
}
于 2014-01-22T09:48:24.610 回答