C# 2.0
---------
I have a bunch of .dlls and I added them to my resources as embedded resources in my application. I want my application to load them when it gets an assembly resolve error. Although my code seems correct it is not working:
Any ideas??Code://Part of my Main() event in Program.cs AppDomain.CurrentDomain.AssemblyResolve += (object sender, ResolveEventArgs args) => { String res = "AssemblyLoadingReflection." + new AssemblyName(args.Name).Name + ".dll"; using (var stream = Assembly.GetExecutingAssembly().GetManifestResourceStream(res)) { Byte[] assemblyData = new Byte[stream.Length]; stream.Read(assemblyData, 0, assemblyData.Length); return Assembly.Load(assemblyData); } };


Reply With Quote