diff --git a/eng/Versions.props b/eng/Versions.props
index 99fd5d6f4e..7db7ce7940 100644
--- a/eng/Versions.props
+++ b/eng/Versions.props
@@ -185,9 +185,9 @@
15.8.166
1.2.6
15.8.166
- 3.4.0
- 3.4.0
- 3.4.0
+ 3.7.0-4.20351.7
+ 3.7.0-4.20351.7
+ 3.7.0-4.20351.7
3.19.8
6.6.0
6.6.0
diff --git a/src/Analyzers/Analyzers/src/MiddlewareAnalyzer.cs b/src/Analyzers/Analyzers/src/MiddlewareAnalyzer.cs
index 0a8deb5dc4..1395969e10 100644
--- a/src/Analyzers/Analyzers/src/MiddlewareAnalyzer.cs
+++ b/src/Analyzers/Analyzers/src/MiddlewareAnalyzer.cs
@@ -1,4 +1,4 @@
-// Copyright (c) .NET Foundation. All rights reserved.
+// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System.Collections.Immutable;
@@ -33,7 +33,7 @@ namespace Microsoft.AspNetCore.Analyzers
if (context.Operation is IInvocationOperation invocation &&
invocation.Instance == null &&
invocation.Arguments.Length >= 1 &&
- invocation.Arguments[0].Parameter?.Type == _context.StartupSymbols.IApplicationBuilder)
+ SymbolEqualityComparer.Default.Equals(invocation.Arguments[0].Parameter?.Type, _context.StartupSymbols.IApplicationBuilder))
{
middleware.Add(new MiddlewareItem(invocation));
}
diff --git a/src/Analyzers/Analyzers/src/ServicesAnalyzer.cs b/src/Analyzers/Analyzers/src/ServicesAnalyzer.cs
index dc79cf4727..ac74481a88 100644
--- a/src/Analyzers/Analyzers/src/ServicesAnalyzer.cs
+++ b/src/Analyzers/Analyzers/src/ServicesAnalyzer.cs
@@ -1,4 +1,4 @@
-// Copyright (c) .NET Foundation. All rights reserved.
+// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System.Collections.Immutable;
@@ -28,7 +28,7 @@ namespace Microsoft.AspNetCore.Analyzers
if (context.Operation is IInvocationOperation invocation &&
invocation.Instance == null &&
invocation.Arguments.Length >= 1 &&
- invocation.Arguments[0].Parameter?.Type == _context.StartupSymbols.IServiceCollection)
+ SymbolEqualityComparer.Default.Equals(invocation.Arguments[0].Parameter?.Type, _context.StartupSymbols.IServiceCollection))
{
services.Add(new ServicesItem(invocation));
}
diff --git a/src/Analyzers/Analyzers/src/StartupAnalyzer.Diagnostics.cs b/src/Analyzers/Analyzers/src/StartupAnalyzer.Diagnostics.cs
index 0ba7239936..cb2f50997e 100644
--- a/src/Analyzers/Analyzers/src/StartupAnalyzer.Diagnostics.cs
+++ b/src/Analyzers/Analyzers/src/StartupAnalyzer.Diagnostics.cs
@@ -9,6 +9,7 @@ namespace Microsoft.AspNetCore.Analyzers
{
public partial class StartupAnalyzer : DiagnosticAnalyzer
{
+ [System.Diagnostics.CodeAnalysis.SuppressMessage("MicrosoftCodeAnalysisReleaseTracking", "RS2008:Enable analyzer release tracking")]
internal static class Diagnostics
{
public static readonly ImmutableArray SupportedDiagnostics;
diff --git a/src/Analyzers/Analyzers/src/StartupFacts.cs b/src/Analyzers/Analyzers/src/StartupFacts.cs
index f5f833429a..3c5bc9ee9a 100644
--- a/src/Analyzers/Analyzers/src/StartupFacts.cs
+++ b/src/Analyzers/Analyzers/src/StartupFacts.cs
@@ -74,12 +74,7 @@ namespace Microsoft.AspNetCore.Analyzers
return false;
}
- if (symbol.Parameters[0].Type != symbols.IServiceCollection)
- {
- return false;
- }
-
- return true;
+ return SymbolEqualityComparer.Default.Equals(symbol.Parameters[0].Type, symbols.IServiceCollection);
}
// Based on StartupLoader. The philosophy is that we want to do analysis only on things
@@ -114,7 +109,7 @@ namespace Microsoft.AspNetCore.Analyzers
// IApplicationBuilder can appear in any parameter, but must appear.
for (var i = 0; i < symbol.Parameters.Length; i++)
{
- if (symbol.Parameters[i].Type == symbols.IApplicationBuilder)
+ if (SymbolEqualityComparer.Default.Equals(symbol.Parameters[i].Type, symbols.IApplicationBuilder))
{
return true;
}
diff --git a/src/Components/Analyzers/src/DiagnosticDescriptors.cs b/src/Components/Analyzers/src/DiagnosticDescriptors.cs
index 05b98d3b4a..8b4bfdb154 100644
--- a/src/Components/Analyzers/src/DiagnosticDescriptors.cs
+++ b/src/Components/Analyzers/src/DiagnosticDescriptors.cs
@@ -5,6 +5,7 @@ using Microsoft.CodeAnalysis;
namespace Microsoft.AspNetCore.Components.Analyzers
{
+ [System.Diagnostics.CodeAnalysis.SuppressMessage("MicrosoftCodeAnalysisReleaseTracking", "RS2008:Enable analyzer release tracking")]
internal static class DiagnosticDescriptors
{
// Note: The Razor Compiler (including Components features) use the RZ prefix for diagnostics, so there's currently
diff --git a/src/Mvc/Mvc.Analyzers/src/DiagnosticDescriptors.cs b/src/Mvc/Mvc.Analyzers/src/DiagnosticDescriptors.cs
index 76b068a928..8c374422f8 100644
--- a/src/Mvc/Mvc.Analyzers/src/DiagnosticDescriptors.cs
+++ b/src/Mvc/Mvc.Analyzers/src/DiagnosticDescriptors.cs
@@ -5,6 +5,7 @@ using Microsoft.CodeAnalysis;
namespace Microsoft.AspNetCore.Mvc.Analyzers
{
+ [System.Diagnostics.CodeAnalysis.SuppressMessage("MicrosoftCodeAnalysisReleaseTracking", "RS2008:Enable analyzer release tracking")]
public static class DiagnosticDescriptors
{
public static readonly DiagnosticDescriptor MVC1000_HtmlHelperPartialShouldBeAvoided =
diff --git a/src/Mvc/Mvc.Api.Analyzers/src/ApiActionsDoNotRequireExplicitModelValidationCheckAnalyzer.cs b/src/Mvc/Mvc.Api.Analyzers/src/ApiActionsDoNotRequireExplicitModelValidationCheckAnalyzer.cs
index 274609128f..d884ed3504 100644
--- a/src/Mvc/Mvc.Api.Analyzers/src/ApiActionsDoNotRequireExplicitModelValidationCheckAnalyzer.cs
+++ b/src/Mvc/Mvc.Api.Analyzers/src/ApiActionsDoNotRequireExplicitModelValidationCheckAnalyzer.cs
@@ -84,7 +84,9 @@ namespace Microsoft.AspNetCore.Mvc.Api.Analyzers
return;
}
+#pragma warning disable RS1030 // Do not invoke Compilation.GetSemanticModel() method within a diagnostic analyzer
var semanticModel = operationAnalysisContext.Compilation.GetSemanticModel(methodSyntax.SyntaxTree);
+#pragma warning restore RS1030 // Do not invoke Compilation.GetSemanticModel() method within a diagnostic analyzer
var methodSymbol = semanticModel.GetDeclaredSymbol(methodSyntax, operationAnalysisContext.CancellationToken);
if (!ApiControllerFacts.IsApiControllerAction(symbolCache, methodSymbol))
diff --git a/src/Mvc/Mvc.Api.Analyzers/src/ApiDiagnosticDescriptors.cs b/src/Mvc/Mvc.Api.Analyzers/src/ApiDiagnosticDescriptors.cs
index ff56f64f1c..da4184604c 100644
--- a/src/Mvc/Mvc.Api.Analyzers/src/ApiDiagnosticDescriptors.cs
+++ b/src/Mvc/Mvc.Api.Analyzers/src/ApiDiagnosticDescriptors.cs
@@ -5,6 +5,7 @@ using Microsoft.CodeAnalysis;
namespace Microsoft.AspNetCore.Mvc.Api.Analyzers
{
+ [System.Diagnostics.CodeAnalysis.SuppressMessage("MicrosoftCodeAnalysisReleaseTracking", "RS2008:Enable analyzer release tracking")]
internal static class ApiDiagnosticDescriptors
{
public static readonly DiagnosticDescriptor API1000_ActionReturnsUndocumentedStatusCode =
diff --git a/src/Mvc/Mvc.Razor.RuntimeCompilation/test/RuntimeViewCompilerTest.cs b/src/Mvc/Mvc.Razor.RuntimeCompilation/test/RuntimeViewCompilerTest.cs
index e9f22da610..6c916309dc 100644
--- a/src/Mvc/Mvc.Razor.RuntimeCompilation/test/RuntimeViewCompilerTest.cs
+++ b/src/Mvc/Mvc.Razor.RuntimeCompilation/test/RuntimeViewCompilerTest.cs
@@ -765,7 +765,7 @@ this should fail";
// Arrange
var viewPath = "some-relative-path";
var fileContent = "file content";
- var content = "this should fail";
+ var content = "public class Bad { this should fail }";
var compiler = GetViewCompiler(new TestFileProvider());
var codeDocument = RazorCodeDocument.Create(RazorSourceDocument.Create(fileContent, viewPath));
diff --git a/src/Razor/test/Microsoft.AspNetCore.Razor.Test.Common/Language/IntegrationTests/IntegrationTestBase.cs b/src/Razor/test/Microsoft.AspNetCore.Razor.Test.Common/Language/IntegrationTests/IntegrationTestBase.cs
index 4cb0df598b..02024ecb1d 100644
--- a/src/Razor/test/Microsoft.AspNetCore.Razor.Test.Common/Language/IntegrationTests/IntegrationTestBase.cs
+++ b/src/Razor/test/Microsoft.AspNetCore.Razor.Test.Common/Language/IntegrationTests/IntegrationTestBase.cs
@@ -121,7 +121,7 @@ namespace Microsoft.AspNetCore.Razor.Language.IntegrationTests
protected CSharpSyntaxTree AddCSharpSyntaxTree(string text, string? filePath = null)
{
- var syntaxTree = (CSharpSyntaxTree)CSharpSyntaxTree.ParseText(text, CSharpParseOptions, path: filePath);
+ var syntaxTree = (CSharpSyntaxTree)CSharpSyntaxTree.ParseText(text, CSharpParseOptions, path: filePath ?? string.Empty);
CSharpSyntaxTrees.Add(syntaxTree);
return syntaxTree;
}