本文整理汇总了C#中Loader.DoLoad方法的典型用法代码示例。如果您正苦于以下问题:C# Loader.DoLoad方法的具体用法?C# Loader.DoLoad怎么用?C# Loader.DoLoad使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Loader
的用法示例。
在下文中一共展示了Loader.DoLoad方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: LoadEngine
public static Engine LoadEngine(NAnt.Core.FrameworkInfo framework) {
//System.AppDomainSetup myDomainSetup = new System.AppDomainSetup();
//myDomainSetup.ApplicationBase = AppDomain.CurrentDomain.BaseDirectory;
//myDomainSetup.ApplicationName = "MSBuild";
//string tempFile = Path.GetTempFileName();
//using (StreamWriter sw = File.CreateText(tempFile))
//{
// sw.WriteLine(String.Format(
// "<?xml version='1.0'?><configuration><runtime>"
// + "<assemblyBinding xmlns='urn:schemas-microsoft-com:asm.v1'>"
// + "<dependentAssembly><assemblyIdentity name='Microsoft.Build.Framework' publicKeyToken='b03f5f7f11d50a3a' culture='neutral'/><bindingRedirect oldVersion='0.0.0.0-99.9.9.9' newVersion='{0}'/></dependentAssembly>"
// + "<dependentAssembly><assemblyIdentity name='Microsoft.Build.Engine' publicKeyToken='b03f5f7f11d50a3a' culture='neutral'/><bindingRedirect oldVersion='0.0.0.0-99.9.9.9' newVersion='{0}'/></dependentAssembly>"
// + "</assemblyBinding></runtime></configuration>",
// new Version(framework.Version.Major, framework.Version.Minor, 0, 0)));
//}
//myDomainSetup.ConfigurationFile = tempFile;// AppDomain.CurrentDomain.SetupInformation.ConfigurationFile;
//var executionAD = AppDomain.CreateDomain(myDomainSetup.ApplicationName,
// AppDomain.CurrentDomain.Evidence, myDomainSetup);
//AppDomain.CurrentDomain.AssemblyLoad += new AssemblyLoadEventHandler(CurrentDomain_AssemblyLoad);
//executionAD.AssemblyLoad += new AssemblyLoadEventHandler(executionAD_AssemblyLoad);
//File.Delete(tempFile);
//Loader l = (Loader)executionAD.CreateInstanceAndUnwrap(typeof(Loader).Assembly.FullName, typeof(Loader).FullName);
Loader l = new Loader();
l.framework = framework;
//executionAD.DoCallBack(new CrossAppDomainDelegate(l.DoLoad));
l.DoLoad();
return l.engine;
}