Пример #1
0
        private static string?GetFileName(IAssemblyReference reference, IModule parent, InputAssembliesGroup input, NuGetFramework framework)
        {
            var extensions = reference.IsWindowsRuntime ? new[] { ".winmd", ".dll" } : new[] { ".exe", ".dll" };

            if (reference.IsWindowsRuntime)
            {
                return(AssemblyHelpers.FindWindowsMetadataFile(reference.Name, reference.Version));
            }

            string?file;

            if (reference.Name == "mscorlib")
            {
                file = GetCorlib(reference);
                if (!string.IsNullOrWhiteSpace(file))
                {
                    return(file);
                }
            }

            file = FindInParentDirectory(reference, parent, extensions);

            if (!string.IsNullOrWhiteSpace(file))
            {
                return(file);
            }

            file = SearchDirectories(reference, input, extensions);

            return(!string.IsNullOrWhiteSpace(file) ? file : SearchNugetFrameworkDirectories(reference, extensions, framework));
        }