0
간단한 컴파일러를 개발 중이며 IL 코드가 생성 된 후 마지막 단계는 충돌이 발생하는 ilasm
유틸리티로 컴파일합니다. 여기 Process.Start가 예외없이 중단됨
public static string ExecuteIL(string filename)
{
var ilasmp = new System.Diagnostics.Process();
ilasmp.StartInfo.FileName = "ilasm";
ilasmp.StartInfo.Arguments = filename;
//Crash does not happen here:
ilasmp.Start();
ilasmp.WaitForExit();
var p = new System.Diagnostics.Process();
p.StartInfo.FileName = "/usr/bin/time";
p.StartInfo.Arguments = "mono " + filename.Replace(".il", ".exe");
p.StartInfo.UseShellExecute = true;
p.StartInfo.RedirectStandardOutput = true;
p.StartInfo.RedirectStandardError = true;
try{
//Crash happens HERE, but for some reason the exception does not get thrown
p.Start();
}
catch{
throw new Exception();
}
string output = p.StandardOutput.ReadToEnd();
p.WaitForExit();
return output;
}
그냥 명확하게하기 : 내가 처음 (ilasmp.Start();
)에 대한 Process.Start
를 호출 할 때 충돌이 발생하지 않고 웬일인지 나중에 (p.Start();
), 그리고 흥미로운 점은 예외가 발생하지 않는다는 것입니다. 또는 다른 말로하면 코드가 단순히 충돌합니다. 당신이 마이크로 소프트에서
UseShellExecute = true;
을 설정하는 거라면
사용하는 모노의 버전? – knocte
@knocte, 나는 그것이 최신 버전 중 하나라고 생각한다. 모노 버전의 정확한 반환은 다음과 같다 :'Mono JIT 컴파일러 버전 4.2.4 (tarball 6 월 10 일 10:12:47 UTC 2016)' –
무엇 OS? 어떻게 그 모노 버전을 설치 했습니까? – knocte