diff --git a/src/dotnet/Azure.ClientSdk.Analyzers/Azure.ClientSdk.Analyzers/BannedTypesAnalyzer.cs b/src/dotnet/Azure.ClientSdk.Analyzers/Azure.ClientSdk.Analyzers/BannedTypesAnalyzer.cs index 64185d16da9..03780260b5c 100644 --- a/src/dotnet/Azure.ClientSdk.Analyzers/Azure.ClientSdk.Analyzers/BannedTypesAnalyzer.cs +++ b/src/dotnet/Azure.ClientSdk.Analyzers/Azure.ClientSdk.Analyzers/BannedTypesAnalyzer.cs @@ -51,6 +51,11 @@ static void CheckType(ISymbolAnalysisContext context, ITypeSymbol type, ISymbol } } + if (IsAzureCore(context.Symbol.ContainingAssembly)) + { + return; + } + switch (context.Symbol) { case IParameterSymbol parameterSymbol: @@ -77,5 +82,10 @@ static void CheckType(ISymbolAnalysisContext context, ITypeSymbol type, ISymbol break; } } + + private bool IsAzureCore(IAssemblySymbol assembly) + { + return assembly.Name.Equals("Azure.Core"); + } } }