반드시 동일하지는 않습니다. 같은 디렉토리에 콘솔 응용 프로그램이 두 프로그램을 컴파일
// In Test.cs, compile to Test.exe
using System;
using System.Reflection;
public static class Program
{
static void Main(string[] args)
{
AppDomain.CreateDomain("NewDomain").ExecuteAssembly("Test2.exe");
}
}
// In Test2.cs, compile to Test2.exe
using System;
using System.Diagnostics;
using System.Reflection;
class Test2
{
static void Main()
{
Console.WriteLine("Process: {0}",
Process.GetCurrentProcess().ProcessName);
Console.WriteLine("Entry assembly: {0}",
Assembly.GetEntryAssembly().CodeBase);
}
}
출력 :
Process: Test
Entry assembly: file:///c:/Users/Jon/Test/Test2.EXE
Jon Skeet의 좋은 예 http://stackoverflow.com/a/8406779/37759 –