23 instantiations of AssemblyIdentity
GenerateDocumentationAndConfigFiles (1)
Microsoft.CodeAnalysis (9)
Microsoft.CodeAnalysis.Analyzers (1)
Microsoft.CodeAnalysis.AnalyzerUtilities (1)
Microsoft.CodeAnalysis.CodeStyle (1)
Microsoft.CodeAnalysis.CSharp (4)
Microsoft.CodeAnalysis.ResxSourceGenerator (1)
Microsoft.CodeAnalysis.Scripting (2)
Microsoft.CodeAnalysis.Workspaces (1)
Roslyn.Diagnostics.Analyzers (1)
rzc (1)
391 references to AssemblyIdentity
GenerateDocumentationAndConfigFiles (1)
Microsoft.CodeAnalysis (204)
Diagnostic\CommonMessageProvider.cs (4)
210public abstract void ReportDuplicateMetadataReferenceStrong(DiagnosticBag diagnostics, Location location, MetadataReference reference, AssemblyIdentity identity, MetadataReference equivalentReference, AssemblyIdentity equivalentIdentity);
211public abstract void ReportDuplicateMetadataReferenceWeak(DiagnosticBag diagnostics, Location location, MetadataReference reference, AssemblyIdentity identity, MetadataReference equivalentReference, AssemblyIdentity equivalentIdentity);
MetadataReference\AssemblyIdentity.DisplayName.cs (6)
156public static bool TryParseDisplayName(string displayName, [NotNullWhen(true)] out AssemblyIdentity? identity)
175private static readonly ConcurrentCache<string, (AssemblyIdentity? identity, AssemblyIdentityParts parts)> s_TryParseDisplayNameCache =
176new ConcurrentCache<string, (AssemblyIdentity? identity, AssemblyIdentityParts parts)>(1024, ReferenceEqualityComparer.Instance);
195public static bool TryParseDisplayName(string displayName, [NotNullWhen(true)] out AssemblyIdentity? identity, out AssemblyIdentityParts parts)
199if (tryParseDisplayName(displayName, out var localIdentity, out var localParts))
210static bool tryParseDisplayName(string displayName, [NotNullWhen(true)] out AssemblyIdentity? identity, out AssemblyIdentityParts parts)
MetadataReference\AssemblyIdentityComparer.cs (16)
33/// A set of possible outcomes of <see cref="AssemblyIdentity"/> comparison.
60public bool ReferenceMatchesDefinition(string referenceDisplayName, AssemblyIdentity definition)
71public bool ReferenceMatchesDefinition(AssemblyIdentity reference, AssemblyIdentity definition)
81public ComparisonResult Compare(AssemblyIdentity reference, AssemblyIdentity definition)
87internal ComparisonResult Compare(AssemblyIdentity? reference, string? referenceDisplayName, AssemblyIdentity definition, out bool unificationApplied, bool ignoreVersion)
106if (!AssemblyIdentity.TryParseDisplayName(referenceDisplayName!, out reference, out parts) ||
136if (!AssemblyIdentity.IsFullName(parts))
166if (comparePublicKeyToken && !AssemblyIdentity.KeysEqual(reference, definition))
205private static bool? TriviallyEquivalent(AssemblyIdentity x, AssemblyIdentity y)
219return AssemblyIdentity.MemberwiseEqual(x, y);
222internal virtual bool ApplyUnificationPolicies(ref AssemblyIdentity reference, ref AssemblyIdentity definition, AssemblyIdentityParts referenceParts, out bool isDefinitionFxAssembly)
MetadataReference\AssemblyIdentityMap.cs (13)
21private readonly Dictionary<string, OneOrMany<KeyValuePair<AssemblyIdentity, TValue>>> _map;
25_map = new Dictionary<string, OneOrMany<KeyValuePair<AssemblyIdentity, TValue>>>(AssemblyIdentityComparer.SimpleNameComparer);
28public bool Contains(AssemblyIdentity identity, bool allowHigherVersion = true)
34public bool TryGetValue(AssemblyIdentity identity, out TValue value, bool allowHigherVersion = true)
36OneOrMany<KeyValuePair<AssemblyIdentity, TValue>> sameName;
43AssemblyIdentity currentIdentity = sameName[i].Key;
45if (AssemblyIdentity.EqualIgnoringNameAndVersion(currentIdentity, identity))
77public bool TryGetValue(AssemblyIdentity identity, out TValue value, Func<Version, Version, TValue, bool> comparer)
79OneOrMany<KeyValuePair<AssemblyIdentity, TValue>> sameName;
84AssemblyIdentity currentIdentity = sameName[i].Key;
87AssemblyIdentity.EqualIgnoringNameAndVersion(currentIdentity, identity))
99public void Add(AssemblyIdentity identity, TValue value)
103OneOrMany<KeyValuePair<AssemblyIdentity, TValue>> sameName;
ReferenceManager\CommonReferenceManager.Binding.cs (9)
105ref ImmutableDictionary<AssemblyIdentity, PortableExecutableReference?> implicitReferenceResolutions,
222ref ImmutableDictionary<AssemblyIdentity, PortableExecutableReference?> implicitReferenceResolutions,
235var resolutionFailures = PooledHashSet<AssemblyIdentity>.GetInstance();
272out AssemblyIdentity? resolvedAssemblyIdentity,
313foreach (var assemblyIdentity in resolutionFailures)
526AssemblyIdentity referenceIdentity,
527ref ImmutableDictionary<AssemblyIdentity, PortableExecutableReference?> implicitReferenceResolutions,
530[NotNullWhen(true)] out AssemblyIdentity? resolvedAssemblyIdentity,
985private static bool IsSuperseded(AssemblyIdentity identity, IReadOnlyDictionary<string, List<ReferencedAssemblyIdentity>> assemblyReferencesBySimpleName)
ReferenceManager\CommonReferenceManager.State.cs (17)
48internal abstract ImmutableDictionary<AssemblyIdentity, PortableExecutableReference?> ImplicitReferenceResolutions { get; }
126/// For each such assembly identity <see cref="MetadataReferenceResolver.ResolveMissingAssembly(MetadataReference, AssemblyIdentity)"/> is called
132private ImmutableDictionary<AssemblyIdentity, PortableExecutableReference?>? _lazyImplicitReferenceResolutions;
259internal override ImmutableDictionary<AssemblyIdentity, PortableExecutableReference?> ImplicitReferenceResolutions
414ImmutableDictionary<AssemblyIdentity, PortableExecutableReference?> implicitReferenceResolutions,
542internal static ImmutableDictionary<AssemblyIdentity, AssemblyIdentity> GetAssemblyReferenceIdentityBaselineMap(ImmutableArray<TAssemblySymbol> symbols, ImmutableArray<AssemblyIdentity> originalIdentities)
546ImmutableDictionary<AssemblyIdentity, AssemblyIdentity>.Builder? lazyBuilder = null;
549var symbolIdentity = symbols[i].Identity;
551var originalIdentity = originalIdentities[i];
557lazyBuilder = lazyBuilder ?? ImmutableDictionary.CreateBuilder<AssemblyIdentity, AssemblyIdentity>();
559var sourceIdentity = symbolIdentity.WithVersion(versionPattern);
576return lazyBuilder?.ToImmutable() ?? ImmutableDictionary<AssemblyIdentity, AssemblyIdentity>.Empty;
Microsoft.CodeAnalysis.Analyzers (3)
Microsoft.CodeAnalysis.AnalyzerUtilities (1)
Microsoft.CodeAnalysis.CodeStyle (1)
Microsoft.CodeAnalysis.CSharp (71)
Errors\MessageProvider.cs (4)
205public override void ReportDuplicateMetadataReferenceStrong(DiagnosticBag diagnostics, Location location, MetadataReference reference, AssemblyIdentity identity, MetadataReference equivalentReference, AssemblyIdentity equivalentIdentity)
212public override void ReportDuplicateMetadataReferenceWeak(DiagnosticBag diagnostics, Location location, MetadataReference reference, AssemblyIdentity identity, MetadataReference equivalentReference, AssemblyIdentity equivalentIdentity)
Symbols\ReferenceManager.cs (26)
118protected override bool WeakIdentityPropertiesEquivalent(AssemblyIdentity identity1, AssemblyIdentity identity2)
246public PEAssemblySymbol CreatePEAssemblyForAssemblyMetadata(AssemblyMetadata metadata, MetadataImportOptions importOptions, out ImmutableDictionary<AssemblyIdentity, AssemblyIdentity> assemblyReferenceIdentityMap)
280private static AssemblySymbol MapAssemblyIdentityToResolvedSymbol(AssemblyIdentity identity, AssemblyIdentityMap<AssemblySymbol> map)
379ImmutableDictionary<AssemblyIdentity, PortableExecutableReference?>.Empty;
457Dictionary<AssemblyIdentity, MissingAssemblySymbol>? missingAssemblies = null;
541Dictionary<AssemblyIdentity, MissingAssemblySymbol>? missingAssemblies)
642ref Dictionary<AssemblyIdentity, MissingAssemblySymbol>? missingAssemblies,
654ImmutableArray<AssemblyIdentity> referencedAssemblies =
674var filteredReferencedAssemblies = new AssemblyIdentity[referencedAssemblies.Length - linkedUnderlyingReferences];
719ref Dictionary<AssemblyIdentity, MissingAssemblySymbol>? missingAssemblies,
733var identities = new AssemblyIdentity[moduleReferenceCount];
764ref Dictionary<AssemblyIdentity, MissingAssemblySymbol>? missingAssemblies,
777var identities = new AssemblyIdentity[refsCount];
842AssemblyIdentity assemblyIdentity,
843ref Dictionary<AssemblyIdentity, MissingAssemblySymbol>? missingAssemblies)
849missingAssemblies = new Dictionary<AssemblyIdentity, MissingAssemblySymbol>();
865private readonly AssemblyIdentity _identity;
866private readonly ImmutableArray<AssemblyIdentity> _referencedAssemblies;
870AssemblyIdentity identity,
871ImmutableArray<AssemblyIdentity> referencedAssemblies,
884public override AssemblyIdentity Identity
914public override ImmutableArray<AssemblyIdentity> AssemblyReferences
1093private static ImmutableArray<AssemblyIdentity> GetReferencedAssemblies(CSharpCompilation compilation)
1113var result = ArrayBuilder<AssemblyIdentity>.GetInstance(builderSize);
Microsoft.CodeAnalysis.Features (23)
Microsoft.CodeAnalysis.NetAnalyzers (1)
Microsoft.CodeAnalysis.Razor.Compiler (7)
Microsoft.CodeAnalysis.ResxSourceGenerator (1)
Microsoft.CodeAnalysis.Scripting (45)
Microsoft.CodeAnalysis.Workspaces (1)
Microsoft.CodeAnalysis.Workspaces.MSBuild (3)
Microsoft.DotNet.ApiCompatibility (3)
Roslyn.Diagnostics.Analyzers (1)
rzc (25)
DefaultExtensionAssemblyLoader.cs (14)
19private readonly Dictionary<string, (Assembly assembly, AssemblyIdentity identity)> _loadedByPath;
20private readonly Dictionary<AssemblyIdentity, Assembly> _loadedByIdentity;
21private readonly Dictionary<string, AssemblyIdentity> _identityCache;
30_loadedByPath = new Dictionary<string, (Assembly assembly, AssemblyIdentity identity)>(StringComparer.OrdinalIgnoreCase);
31_loadedByIdentity = new Dictionary<AssemblyIdentity, Assembly>();
32_identityCache = new Dictionary<string, AssemblyIdentity>(StringComparer.OrdinalIgnoreCase);
70if (!AssemblyIdentity.TryParseDisplayName(assemblyName, out var identity))
90var candidateIdentity = GetIdentity(path);
123private Assembly LoadFromPathUnsafe(string filePath, AssemblyIdentity identity)
146identity = identity ?? AssemblyIdentity.FromAssemblyDefinition(assembly);
162private AssemblyIdentity GetIdentity(string filePath)
164if (!_identityCache.TryGetValue(filePath, out var identity))
195private static AssemblyIdentity ReadAssemblyIdentity(string filePath)