public static string shellm(string filename, params string[] arguments)
{
AppDomainSetup setup = new AppDomainSetup();
setup.ApplicationBase = Path.GetDirectoryName(Path.GetFullPath(filename));
AppDomain domain = AppDomain.CreateDomain("shellm", null, setup);
try
{
AssemblyExecutor executor = new AssemblyExecutor(filename, arguments);
domain.DoCallBack(new CrossAppDomainDelegate(executor.Execute));
return executor.CapturedOutput;
}
finally
{
AppDomain.Unload(domain);
}
}