public override ImmutableArray <PortableExecutableReference> ResolveReference(
     string reference,
     string?baseFilePath,
     MetadataReferenceProperties properties
     )
 {
     if (
         NuGetPackageResolver.TryParsePackageReference(
             reference,
             out string packageName,
             out string packageVersion
             )
         )
     {
         if (PackageResolver != null)
         {
             var paths = PackageResolver.ResolveNuGetPackage(packageName, packageVersion);
             Debug.Assert(!paths.IsDefault);
             return(paths.SelectAsArray(path => _fileReferenceProvider(path, properties)));
         }
     }
        public override ImmutableArray <PortableExecutableReference> ResolveReference(string reference, string baseFilePath, MetadataReferenceProperties properties)
        {
            string packageName;
            string packageVersion;

            if (NuGetPackageResolver.TryParsePackageReference(reference, out packageName, out packageVersion))
            {
                if (PackageResolver != null)
                {
                    var paths = PackageResolver.ResolveNuGetPackage(packageName, packageVersion);
                    Debug.Assert(!paths.IsDefault);
                    return(paths.SelectAsArray(path => _fileReferenceProvider(path, properties)));
                }
            }
            else if (PathUtilities.IsFilePath(reference))
            {
                if (PathResolver != null)
                {
                    var resolvedPath = PathResolver.ResolvePath(reference, baseFilePath);
                    if (resolvedPath != null)
                    {
                        return(ImmutableArray.Create(_fileReferenceProvider(resolvedPath, properties)));
                    }
                }
            }
            else if (GacFileResolver != null)
            {
                var path = GacFileResolver.Resolve(reference);
                if (path != null)
                {
                    return(ImmutableArray.Create(_fileReferenceProvider(path, properties)));
                }
            }

            return(ImmutableArray <PortableExecutableReference> .Empty);
        }