첨부 소스 코드는 나눔고딕코딩 폰트를 사용합니다.
728x90
반응형
728x170

TestSolution.zip
다운로드

[TestLoader 프로젝트]

▶ Program.cs

using System;
using System.IO;

namespace TestLoader
{
    /// <summary>
    /// 프로그램
    /// </summary>
    class Program
    {
        //////////////////////////////////////////////////////////////////////////////////////////////////// Method
        ////////////////////////////////////////////////////////////////////////////////////////// Static
        //////////////////////////////////////////////////////////////////////////////// Private

        #region 프로그램 시작하기 - Main()

        /// <summary>
        /// 프로그램 시작하기
        /// </summary>
        [LoaderOptimization(LoaderOptimization.MultiDomainHost)]
        [STAThread]
        private static void Main()
        {
            string applicationDirectoryPath = @"D:\TestSolution\TestProject\bin\Debug";
            string cacheDirectoryPath       = Path.Combine(applicationDirectoryPath, "__cache");
            string configurationFilePath    = Path.Combine(applicationDirectoryPath, "TestProject.exe.config");

            string assemblyFilePath = Path.Combine(applicationDirectoryPath, "TestProject.exe");

            AppDomainSetup setup = new AppDomainSetup();

            setup.ApplicationName   = "TestProject";
            setup.ShadowCopyFiles   = "true";
            setup.CachePath         = cacheDirectoryPath;
            setup.ConfigurationFile = configurationFilePath;

            AppDomain appDomain = AppDomain.CreateDomain("TestProject", AppDomain.CurrentDomain.Evidence, setup);

            appDomain.ExecuteAssembly(assemblyFilePath);

            AppDomain.Unload(appDomain);

            Directory.Delete(cacheDirectoryPath, true);
        }

        #endregion
    }
}
728x90
반응형
그리드형(광고전용)
Posted by icodebroker

댓글을 달아 주세요