src/TypeCatalogGen/TypeCatalogGen.cs
/// <summary>
/// Resolve the reference assembly file paths
/// </summary>
Resolve the reference assembly file paths
Resolve the reference assembly file paths
private static List<string> ResolveReferenceAssemblies(string path)
        {
            if (string.IsNullOrWhiteSpace(path))
            {
                throw new ArgumentNullException(Param_ReferenceListPath);
            }
            string referenceListPath = Path.GetFullPath(path);
            if (!File.Exists(referenceListPath))
            {
                string message = string.Format(CultureInfo.CurrentCulture, ReferenceListFileNotFound, referenceListPath ?? "null");
                throw new ArgumentException(message);
            }
            string allText = File.ReadAllText(referenceListPath);
            string[] references = allText.Split(new char[] { ';' }, StringSplitOptions.RemoveEmptyEntries);
            List<string> refAssemblyFiles = new List<string>(120);
            for (int i = 0; i < references.Length; i++)
            {
                if (string.IsNullOrWhiteSpace(references[i]))
                {
                    continue;
                }
                string refAssemblyPath = references[i].Trim();
                if (File.Exists(refAssemblyPath))
                {
                    refAssemblyFiles.Add(refAssemblyPath);
                }
                else
                {
                    string message = string.Format(CultureInfo.CurrentCulture, RefAssemblyNotFound, refAssemblyPath, referenceListPath);
                    throw new InvalidDataException(message);
                }
            }
            return refAssemblyFiles;
        }
private static List < string > ResolveReferenceAssemblies ( string path ) { if ( string . IsNullOrWhiteSpace ( path ) ) { throw new ArgumentNullException ( Param_ReferenceListPath ) ; } string referenceListPath = Path . GetFullPath ( path ) ; if ( ! File . Exists ( referenceListPath ) ) { string message = string . Format ( CultureInfo . CurrentCulture , ReferenceListFileNotFound , referenceListPath ?? " " ) ; throw new ArgumentException ( message ) ; } string allText = File . ReadAllText ( referenceListPath ) ; string [ ] references = allText . Split ( new char [ ] { ' ' } , StringSplitOptions . RemoveEmptyEntries ) ; List < string > refAssemblyFiles = new List < string > ( 120 ) ; for ( int i = 0 ; i < references . Length ; i ++ ) { if ( string . IsNullOrWhiteSpace ( references [ i ] ) ) { continue ; } string refAssemblyPath = references [ i ] . Trim ( ) ; if ( File . Exists ( refAssemblyPath ) ) { refAssemblyFiles . Add ( refAssemblyPath ) ; } else { string message = string . Format ( CultureInfo . CurrentCulture , RefAssemblyNotFound , refAssemblyPath , referenceListPath ) ; throw new InvalidDataException ( message ) ; } } return refAssemblyFiles ; }
Resolve the reference assembly file paths
Resolve the reference assembly file paths
// Ignore entries that only contain white spaces
path
string