26 instantiations of AssemblyIdentity
GenerateDocumentationAndConfigFiles (1)
Microsoft.CodeAnalysis (9)
Microsoft.CodeAnalysis.Analyzers (1)
Microsoft.CodeAnalysis.AnalyzerUtilities (1)
Microsoft.CodeAnalysis.CodeStyle (1)
Microsoft.CodeAnalysis.CSharp (5)
Microsoft.CodeAnalysis.ResxSourceGenerator (1)
Microsoft.CodeAnalysis.Scripting (2)
Microsoft.CodeAnalysis.VisualBasic (2)
Microsoft.CodeAnalysis.Workspaces (1)
Roslyn.Diagnostics.Analyzers (1)
rzc (1)
452 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 (72)
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.Razor.Compiler (7)
Microsoft.CodeAnalysis.ResxSourceGenerator (1)
Microsoft.CodeAnalysis.Scripting (45)
Microsoft.CodeAnalysis.VisualBasic (61)
Errors\MessageProvider.vb (4)
386Public Overrides Sub ReportDuplicateMetadataReferenceStrong(diagnostics As DiagnosticBag, location As Location, reference As MetadataReference, identity As AssemblyIdentity, equivalentReference As MetadataReference, equivalentIdentity As AssemblyIdentity)
393Public Overrides Sub ReportDuplicateMetadataReferenceWeak(diagnostics As DiagnosticBag, location As Location, reference As MetadataReference, identity As AssemblyIdentity, equivalentReference As MetadataReference, equivalentIdentity As AssemblyIdentity)
Symbols\ReferenceManager.vb (27)
129Protected Overrides Function WeakIdentityPropertiesEquivalent(identity1 As AssemblyIdentity, identity2 As AssemblyIdentity) As Boolean
209Friend Function CreatePEAssemblyForAssemblyMetadata(metadata As AssemblyMetadata, importOptions As MetadataImportOptions, <Out> ByRef assemblyReferenceIdentityMap As ImmutableDictionary(Of AssemblyIdentity, AssemblyIdentity)) As PEAssemblySymbol
239Private Shared Function MapAssemblyIdentityToResolvedSymbol(identity As AssemblyIdentity, map As AssemblyIdentityMap(Of AssemblySymbol)) As AssemblySymbol
328ImmutableDictionary(Of AssemblyIdentity, PortableExecutableReference).Empty)
398Dim missingAssemblies As Dictionary(Of AssemblyIdentity, MissingAssemblySymbol) = Nothing
473missingAssemblies As Dictionary(Of AssemblyIdentity, MissingAssemblySymbol))
549ByRef missingAssemblies As Dictionary(Of AssemblyIdentity, MissingAssemblySymbol),
558Dim referencedAssemblies As ImmutableArray(Of AssemblyIdentity) = retargetingAssemblySymbol.UnderlyingAssembly.Modules(j).GetReferencedAssemblies()
574Dim filteredReferencedAssemblies As AssemblyIdentity() =
575New AssemblyIdentity(referencedAssemblies.Length - linkedUnderlyingReferences - 1) {}
615ByRef missingAssemblies As Dictionary(Of AssemblyIdentity, MissingAssemblySymbol),
626Dim names(refsCount - 1) As AssemblyIdentity
654ByRef missingAssemblies As Dictionary(Of AssemblyIdentity, MissingAssemblySymbol),
666Dim identities(refsCount - 1) As AssemblyIdentity
717identity As AssemblyIdentity,
718ByRef missingAssemblies As Dictionary(Of AssemblyIdentity, MissingAssemblySymbol)
723missingAssemblies = New Dictionary(Of AssemblyIdentity, MissingAssemblySymbol)()
738Private ReadOnly _identity As AssemblyIdentity
739Private ReadOnly _referencedAssemblies As ImmutableArray(Of AssemblyIdentity)
742Protected Sub New(identity As AssemblyIdentity,
743referencedAssemblies As ImmutableArray(Of AssemblyIdentity),
756Public Overrides ReadOnly Property Identity As AssemblyIdentity
781Public Overrides ReadOnly Property AssemblyReferences As ImmutableArray(Of AssemblyIdentity)
941Private Shared Function GetReferencedAssemblies(compilation As VisualBasicCompilation) As ImmutableArray(Of AssemblyIdentity)
943Dim refs = ArrayBuilder(Of AssemblyIdentity).GetInstance()
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)