static CSharpCodeCompiler ()
{
if (Path.DirectorySeparatorChar == '\\') {
PropertyInfo gac = typeof (Environment).GetProperty ("GacPath", BindingFlags.Static|BindingFlags.NonPublic);
MethodInfo get_gac = gac.GetGetMethod (true);
string p = Path.GetDirectoryName (
(string) get_gac.Invoke (null, null));
windowsMonoPath = Path.Combine (
Path.GetDirectoryName (
Path.GetDirectoryName (p)),
"bin\\mono.bat");
if (!File.Exists (windowsMonoPath))
windowsMonoPath = Path.Combine (
Path.GetDirectoryName (
Path.GetDirectoryName (p)),
"bin\\mono.exe");
if (!File.Exists (windowsMonoPath))
windowsMonoPath = Path.Combine (
Path.GetDirectoryName (
Path.GetDirectoryName (
Path.GetDirectoryName (p))),
"mono\\mono\\mini\\mono.exe");
if (!File.Exists (windowsMonoPath))
throw new FileNotFoundException ("Windows mono path not found: " + windowsMonoPath);
#if NET_2_0
windowsMcsPath =
Path.Combine (p, "2.0\\gmcs.exe");
#else
windowsMcsPath =
Path.Combine (p, "1.0\\mcs.exe");
#endif
if (!File.Exists (windowsMcsPath))
#if NET_2_0
windowsMcsPath =
Path.Combine(
Path.GetDirectoryName (p),
"lib\\net_2_0\\gmcs.exe");
#else
windowsMcsPath =
Path.Combine(
Path.GetDirectoryName (p),
"lib\\default\\mcs.exe");
#endif
if (!File.Exists (windowsMcsPath))
throw new FileNotFoundException ("Windows mcs path not found: " + windowsMcsPath);
}
}