static System.Reflection.Assembly CurrentDomain_AssemblyResolve(object sender, ResolveEventArgs args) { string path = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, @"lib\"); path = Path.Combine(path, args.Name.Split(‘,‘)[0]); path = String.Format(@"{0}.dll", path); return System.Reflection.Assembly.LoadFrom(path); } AppDomain.CurrentDomain.AssemblyResolve += CurrentDomain_AssemblyResolve;
时间: 2024-10-20 18:09:01