if (!File.Exists (windowsMonoPath))
throw new FileNotFoundException ("Windows mono path not found: " + windowsMonoPath);
- windowsMcsPath = Path.Combine (p, "4.0\\mcs.exe");
+ windowsMcsPath = Path.Combine (p, "4.5\\mcs.exe");
if (!File.Exists (windowsMcsPath))
windowsMcsPath = Path.Combine(Path.GetDirectoryName (p), "lib\\build\\mcs.exe");
mcsOutput = new StringCollection ();
mcsOutMutex = new Mutex ();
-/*
+#if !NET_4_0
+ /*
+ * !:. KLUDGE WARNING .:!
+ *
+ * When running the 2.0 test suite some assemblies will invoke mcs via
+ * CodeDOM and the new mcs process will find the MONO_PATH variable in its
+ * environment pointing to the net_2_0 library which will cause the runtime
+ * to attempt to load the 2.0 corlib into 4.0 process and thus mcs will
+ * fail. At the same time, we must not touch MONO_PATH when running outside
+ * the test suite, thus the kludge.
+ *
+ * !:. KLUDGE WARNING .:!
+ */
+ if (Environment.GetEnvironmentVariable ("MONO_TESTS_IN_PROGRESS") != null) {
+ string monoPath = Environment.GetEnvironmentVariable ("MONO_PATH");
+ if (!String.IsNullOrEmpty (monoPath)) {
+ monoPath = monoPath.Replace ("/class/lib/net_2_0", "/class/lib/net_4_0");
+ mcs.StartInfo.EnvironmentVariables ["MONO_PATH"] = monoPath;
+ }
+ }
+#endif
+/*
string monoPath = Environment.GetEnvironmentVariable ("MONO_PATH");
- if (monoPath == null)
+ if (monoPath != null)
monoPath = String.Empty;
-
+
string privateBinPath = AppDomain.CurrentDomain.SetupInformation.PrivateBinPath;
if (privateBinPath != null && privateBinPath.Length > 0)
monoPath = String.Format ("{0}:{1}", privateBinPath, monoPath);
dict.Add ("MONO_PATH", monoPath);
}
*/
+ /*
+ * reset MONO_GC_PARAMS - we are invoking compiler possibly with another GC that
+ * may not handle some of the options causing compilation failure
+ */
+ mcs.StartInfo.EnvironmentVariables ["MONO_GC_PARAMS"] = String.Empty;
+
mcs.StartInfo.CreateNoWindow=true;
mcs.StartInfo.UseShellExecute=false;
mcs.StartInfo.RedirectStandardOutput=true;
using (FileStream fs = File.OpenRead(options.OutputAssembly)) {
byte[] buffer = new byte[fs.Length];
fs.Read(buffer, 0, buffer.Length);
- results.CompiledAssembly = Assembly.Load(buffer, null, options.Evidence);
+ results.CompiledAssembly = Assembly.Load(buffer, null);
fs.Close();
}
} else {
break;
}
}
-
-#if NET_4_0
+
+#if NET_4_5
+ args.Append("/sdk:4.5");
+#elif NET_4_0
args.Append("/sdk:4");
#else
args.Append("/sdk:2");