using System; using System.Reflection; namespace prBrowser { public class XYSLocalLoader { private AppDomain appDomain; private RemoteLoader remoteLoader; public XYSLocalLoader() { appDomain = AppDomain.CreateDomain("XYSDomain", null, AppDomain.CurrentDomain.BaseDirectory, "bin", shadowCopyFiles: true); string name = Assembly.GetExecutingAssembly().GetName().FullName; remoteLoader = (RemoteLoader)appDomain.CreateInstanceAndUnwrap(name, typeof(RemoteLoader).FullName); } public string LoadAssembly(string input) { return remoteLoader.GetValue(input); } public void Unload() { AppDomain.Unload(appDomain); appDomain = null; } } }