Beispiel #1
0
 /// <summary>
 /// 清空临时目录
 /// </summary>
 public static void ClearShadowCopyFolder()
 {
     foreach (FileInfo file in ShadowCopyFolder.GetFiles())
     {
         try
         {
             file.Delete();
         }
         catch (Exception)
         { }
     }
 }
Beispiel #2
0
        public static void Initialize()
        {
            Directory.CreateDirectory(ShadowCopyFolder.FullName);
            foreach (var f in ShadowCopyFolder.GetFiles("*.dll", SearchOption.AllDirectories))
            {
                f.Delete();
            }

            foreach (var plug in PluginFolder.GetFiles("*.dll", SearchOption.AllDirectories))
            {
                //var di = Directory.CreateDirectory(Path.Combine(ShadowCopyFolder.FullName, plug.Directory.Name));
                File.Copy(plug.FullName, Path.Combine(ShadowCopyFolder.FullName, plug.Name), true);
            }

            var dFiles = ShadowCopyFolder.GetFiles("*.dll", SearchOption.AllDirectories);

            foreach (var a in dFiles)
            {
                BuildManager.AddReferencedAssembly(Assembly.Load(AssemblyName.GetAssemblyName(a.FullName)));
            }
        }