Example #1
0
		bool Get32BitFlags(string assembly)
		{
			assembly = Path.Combine(binPath, assembly);
			string corflags = FileUtility.GetSdkPath("corflags.exe");
			Assert.IsNotNull(corflags, "corflags.exe not found, this test requires the .NET SDK!");
			ProcessRunner pr = new ProcessRunner();
			Console.WriteLine(corflags + " \"" + assembly + "\"");
			pr.Start(corflags, "\"" + assembly + "\"");
			if (!pr.WaitForExit(5000)) {
				pr.Kill();
				throw new InvalidOperationException("Timeout running corflags");
			} else {
				Console.WriteLine(pr.StandardOutput);
				Match m = Regex.Match(pr.StandardOutput, @"32BIT\s*:\s*([01])");
				if (m.Success) {
					return m.Groups[1].Value == "1";
				} else {
					throw new InvalidOperationException("Invalid corflags output");
				}
			}
		}