private AssemblyInfo ReflectAssemblyInfo(string archivePath, string uri, CompileProcess compileProcess) { AssemblyInfo info = new AssemblyInfo(); AppDomain domain = null; try { string appDomainName = "Interrogator"; AppDomainSetup domainSetup = new AppDomainSetup(); domainSetup.ApplicationName = appDomainName; domainSetup.ApplicationBase = new FileInfo(Application.ExecutablePath).DirectoryName; domain = AppDomain.CreateDomain(appDomainName, null, domainSetup); AssemblyInterrogator remoteWorker = (AssemblyInterrogator)domain.CreateInstanceAndUnwrap(typeof(AssemblyInterrogator).Assembly.FullName, typeof(AssemblyInterrogator).FullName); string errorMessage, exceptionMessage; if (!remoteWorker.GetAssemblyInfo(archivePath, uri, out info, out errorMessage, out exceptionMessage)) { if (RC.ShouldWrite(ConsoleVerbosity.Debug) && String.IsNullOrEmpty(exceptionMessage) == false) { throw new Exception(errorMessage + Environment.NewLine + exceptionMessage); } else { throw new Exception(errorMessage); } //throw new Exception(string.Format("{0} : {1}", Rpx.Strings.Compiler_UnableToLoadAsm, uri)); } info = AssemblyInfo.Clone(info); compileProcess.PassArguments = info.PassArgs; } finally { if (domain != null) { AppDomain.Unload(domain); } } return(info); }