c# - Problems after merging Fluent into main.exe -
my question fluent, merged program.exe
in 1 merged.exe code:
public class program { [stathreadattribute] public static void main() { appdomain.currentdomain.assemblyresolve += onresolveassembly; app.main(); } private static assembly onresolveassembly(object sender, resolveeventargs args) { //we dont' care system assemblies , on... //if (!args.name.tolower().startswith("wpfcontrol")) return null; assembly thisassembly = assembly.getexecutingassembly(); //get name of assemblyfile var name = args.name.substring(0, args.name.indexof(',')) + ".dll"; //load form embedded resources - function not called if assembly in application folder var resources = thisassembly.getmanifestresourcenames().where(s => s.endswith(name)); if (resources.count() > 0) { var resourcename = resources.first(); using (stream stream = thisassembly.getmanifestresourcestream(resourcename)) { if (stream == null) return null; var block = new byte[stream.length]; stream.read(block, 0, block.length); return assembly.load(block); } } return null; } }
my problem fluent ribbon control cant find style, settled them code in app.xaml
<application.resources> <resourcedictionary> <resourcedictionary.mergeddictionaries> <resourcedictionary source="pack://application:,,,/fluent;component/themes/office2010/silver.xaml" /> </resourcedictionary.mergeddictionaries> </resourcedictionary> </application.resources>
the second problem have solution cant connect database(sql express) program when start without visual studio.
when have fluent in same folder works, because don't load embedded referenced fluent. , fluent can find style so.
has had similar experience merging of dll/fluent main.exe , can show me how solved it?
use fody.costura instead, works me (and use fluent).
https://github.com/fody/costura
one of important things let app know must load assembly. force loading in app startup:
console.writeline(typeof(fluent).name);
Comments
Post a Comment