I'm having a really hard time bundling all of my dependencies in my C# WPF project into a single exe, using SmartAssembly 6 (evaluation/trial), because of MahApps.Metro.
This conclusion was drawn when creating a completely empty project with nothing but MahApps.Metro, and still not being able to bundle it.
It throws an exception with an inner exception 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.
I've spent a day and a half trying to resolve this, Googling the error, trying every suggestion I can find, and posting in the official MahApps.Metro chat (https://gitter.im/MahApps/MahApps.Metro). I've tried all kinds of variation where I removed System.Windows.Interactivity dll, added it, moved it to another path, etc.
Using the latest MahApps.Metro package from NuGet, and .NET 4.5. The program works when I run it from Visual Studio 2012, or when I run the application from Debug/Release.
Has anyone ever encountered this problem before? How did you resolve it? Is the problem the bundle application (SmartAssembly 6) or MahApps.Metro? Are there any other bundle programs that you know, or think, will work with MahApps.Metro?
here is my way to put the dlls in a single exe
1) create a folder named
DllsAsResourceand put theMahApps.Metro.dllandSystem.Windows.Interactivity.dllwithAdd as Linkto it2) change the
Build Actionfor the dlls toEmbedded Resource3) change
Copy Localtofalsefor the normal referenced dlls4) create Program.cs
5) set the
Startup objectto theProgram.csin your project properties6) now you have a single exe without publishing the hole dlls
you can look at this demo for all the tips
hope that helps