我在使用SmartAssembly 6 (评估/试用版)将我的C# WPF项目中的所有依赖项打包成单个exe时遇到了很大的困难,因为其中涉及到了MahApps.Metro。
这个结论是在创建一个完全空白的项目,只有MahApps.Metro的情况下得出的,但仍然无法打包。
它抛出了一个内部异常
使用最新的NuGet MahApps.Metro包和.NET 4.5。当我从Visual Studio 2012运行它或从Debug/Release运行应用程序时,程序可以正常工作。
这个结论是在创建一个完全空白的项目,只有MahApps.Metro的情况下得出的,但仍然无法打包。
它抛出了一个内部异常
System.IO.FileNotFoundException: Could not load file or assembly 'System.Windows.Interactivity, Version=4.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.
我花了一天半的时间来解决这个问题,在谷歌上搜索错误信息,尝试每一个我能找到的建议,并在官方的MahApps.Metro聊天室https://gitter.im/MahApps/MahApps.Metro发布了帖子。我尝试了许多不同的变化,例如移除System.Windows.Interactivity dll,添加它,将它移到另一个路径等。使用最新的NuGet MahApps.Metro包和.NET 4.5。当我从Visual Studio 2012运行它或从Debug/Release运行应用程序时,程序可以正常工作。
有人遇到过这个问题吗?你是如何解决的?是捆绑应用程序(SmartAssembly 6)还是MahApps.Metro的问题?你知道或认为还有其他捆绑程序可以与MahApps.Metro一起使用吗?