/// <summary> /// Routine which checks if the compiler is supported by NAnt. /// </summary> /// <returns> /// <see langword="true" /> if the version of the compiler is at /// least <c>13.xx.xxxx</c>; otherwise, <see langword="false" />. /// </returns> private static bool CheckSupportedCompiler() { StringCollection compilers = GetCompilersOnPath(); foreach (string compiler in compilers) { // get major version of compiler int majorVersion = VersionFunctions.GetMajor( FileVersionInfoFunctions.GetProductVersion( FileVersionInfo.GetVersionInfo(compiler))); // the MS compiler supports Managed Extensions starting from // product version 7 (VS.NET 2002) if (majorVersion < 7) { // stop at first compiler that does not meet the required // version, as we're not sure which entry in the PATH the // <cl> task will use return(false); } } // if we made it here, and at least one compiler was on the PATH // then we know its a supported compiler return(compilers.Count > 0); }