diff --git a/eng/SourceBuildPrebuiltBaseline.xml b/eng/SourceBuildPrebuiltBaseline.xml
index 915005ae07dd..5e8c3b3f216f 100644
--- a/eng/SourceBuildPrebuiltBaseline.xml
+++ b/eng/SourceBuildPrebuiltBaseline.xml
@@ -12,7 +12,7 @@
-
+
diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml
index 36e834d2654d..c6001e84985b 100644
--- a/eng/Version.Details.xml
+++ b/eng/Version.Details.xml
@@ -194,6 +194,11 @@
7f9ae67f86a5adc1d9bf2f22f4bf3ec05b6d7b68
+
+ https://github.com/dotnet/symreader
+ 27e584661980ee6d82c419a2a471ae505b7d122e
+
+
https://github.com/dotnet/runtime
37c0371ab3f7651d64a6dfe4c2e8677206fa34ee
@@ -335,22 +340,22 @@
-
+
https://github.com/dotnet/roslyn
- 65df6b1065bae316232a6c9907a8be995302fb5e
+ 28075742c870be732a3f20fcfc540a915bc51820
-
+
https://github.com/dotnet/roslyn
- 65df6b1065bae316232a6c9907a8be995302fb5e
+ 28075742c870be732a3f20fcfc540a915bc51820
-
+
https://github.com/dotnet/roslyn
- 65df6b1065bae316232a6c9907a8be995302fb5e
+ 28075742c870be732a3f20fcfc540a915bc51820
-
+
https://github.com/dotnet/roslyn
- 65df6b1065bae316232a6c9907a8be995302fb5e
+ 28075742c870be732a3f20fcfc540a915bc51820
diff --git a/eng/Versions.props b/eng/Versions.props
index 9dd290771aeb..b9b352c8cf5e 100644
--- a/eng/Versions.props
+++ b/eng/Versions.props
@@ -144,10 +144,10 @@
8.0.0-preview.6.23312.10
8.0.0-preview.6.23312.10
- 4.4.0-4.22520.2
- 4.4.0-4.22520.2
- 4.4.0-4.22520.2
- 4.4.0-4.22520.2
+ 4.7.0-3.23313.12
+ 4.7.0-3.23313.12
+ 4.7.0-3.23313.12
+ 4.7.0-3.23313.12
6.2.2
@@ -163,6 +163,8 @@
8.0.0-alpha.1.23305.2
8.0.0-alpha.1.23312.2
+
+ 2.0.0-beta-23228-03
7.0.0-preview.22423.2
@@ -239,11 +241,11 @@
3.3.1
- 4.5.0
- 4.4.0-4.22520.2
- 4.4.0-4.22520.2
- 4.4.0-4.22520.2
- 4.4.0-4.22520.2
+ 4.7.0-3.23313.12
+ 4.7.0-3.23313.12
+ 4.7.0-3.23313.12
+ 4.7.0-3.23313.12
+ 4.7.0-3.23313.12
3.3.3
1.1.2-beta1.22531.1
1.1.2-beta1.22531.1
diff --git a/src/Framework/AspNetCoreAnalyzers/src/Analyzers/Microsoft.AspNetCore.App.Analyzers.csproj b/src/Framework/AspNetCoreAnalyzers/src/Analyzers/Microsoft.AspNetCore.App.Analyzers.csproj
index 43d258fb37a2..97439d9a3d20 100644
--- a/src/Framework/AspNetCoreAnalyzers/src/Analyzers/Microsoft.AspNetCore.App.Analyzers.csproj
+++ b/src/Framework/AspNetCoreAnalyzers/src/Analyzers/Microsoft.AspNetCore.App.Analyzers.csproj
@@ -8,6 +8,7 @@
Enable
Microsoft.AspNetCore.Analyzers
true
+ true
diff --git a/src/Framework/AspNetCoreAnalyzers/src/Analyzers/Resources.resx b/src/Framework/AspNetCoreAnalyzers/src/Analyzers/Resources.resx
index f3a1901a5ff4..c4347a2b8797 100644
--- a/src/Framework/AspNetCoreAnalyzers/src/Analyzers/Resources.resx
+++ b/src/Framework/AspNetCoreAnalyzers/src/Analyzers/Resources.resx
@@ -1,17 +1,17 @@
-
@@ -211,7 +211,7 @@
Route handler has multiple parameters with the [FromBody] attribute or a parameter with an [AsParameters] attribute where the parameter type contains multiple members with [FromBody] attributes. Only one parameter can have a [FromBody] attribute.
- Route handler has multiple parameters with the [FromBody] attribute.
+ Route handler has multiple parameters with the [FromBody] attribute
Do not use model binding attributes with route handlers
@@ -289,10 +289,10 @@
Complex types referenced by route parameters must be parsable
- Parameter '{0}' of type {1} should define a bool TryParse(string, IFormatProvider, out {1}) method, or implement IParsable<{1}>.
+ Parameter '{0}' of type {1} should define a bool TryParse(string, IFormatProvider, out {1}) method, or implement IParsable<{1}>
- When implementing BindAsync(...) method, the return type must be ValueTask<T>.
+ When implementing BindAsync(...) method, the return type must be ValueTask<T>
Parameter '{0}' of type {1} has a BindAsync(...) method, but the return type is not ValueTask<{1}>. Consider implementing IBindableFromHttpContext<{1}> to enforce implementation.
@@ -310,7 +310,7 @@
Route '{0}' conflicts with another action route. An HTTP request that matches multiple routes results in an ambiguous match error. Fix the conflict by changing the route's pattern, HTTP method, or route constraints.
- Use AddAuthorizationBuilder to register authorization services and construct policies.
+ Use AddAuthorizationBuilder to register authorization services and construct policies
Use AddAuthorizationBuilder
diff --git a/src/Framework/AspNetCoreAnalyzers/test/Microsoft.AspNetCore.App.Analyzers.Test.csproj b/src/Framework/AspNetCoreAnalyzers/test/Microsoft.AspNetCore.App.Analyzers.Test.csproj
index 02dc9b4e3d49..5f223d266110 100644
--- a/src/Framework/AspNetCoreAnalyzers/test/Microsoft.AspNetCore.App.Analyzers.Test.csproj
+++ b/src/Framework/AspNetCoreAnalyzers/test/Microsoft.AspNetCore.App.Analyzers.Test.csproj
@@ -4,6 +4,8 @@
$(DefaultNetCoreTargetFramework)
true
Microsoft.AspNetCore.Analyzers
+
+ $(NoWarn);RS1036;RS2008
diff --git a/src/Http/Http.Extensions/gen/GeneratorSteps.cs b/src/Http/Http.Extensions/gen/GeneratorSteps.cs
index 2608f97a1ee6..a90776d30178 100644
--- a/src/Http/Http.Extensions/gen/GeneratorSteps.cs
+++ b/src/Http/Http.Extensions/gen/GeneratorSteps.cs
@@ -5,5 +5,8 @@ namespace Microsoft.AspNetCore.Http.RequestDelegateGenerator;
internal class GeneratorSteps
{
internal const string EndpointModelStep = nameof(EndpointModelStep);
- internal const string EndpointsWithoutDiagnosicsStep = nameof(EndpointsWithoutDiagnosicsStep);
+ internal const string EndpointsWithoutDiagnosticsStep = nameof(EndpointsWithoutDiagnosticsStep);
+ internal const string EndpointsInterceptorsStep = nameof(EndpointsInterceptorsStep);
+ internal const string EndpointsHelperMethodsStep = nameof(EndpointsHelperMethodsStep);
+ internal const string EndpointsHelperTypesStep = nameof(EndpointsHelperTypesStep);
}
diff --git a/src/Http/Http.Extensions/gen/RequestDelegateGenerator.cs b/src/Http/Http.Extensions/gen/RequestDelegateGenerator.cs
index ca4e7cc17dcd..02b26bcfda08 100644
--- a/src/Http/Http.Extensions/gen/RequestDelegateGenerator.cs
+++ b/src/Http/Http.Extensions/gen/RequestDelegateGenerator.cs
@@ -9,8 +9,8 @@
using Microsoft.AspNetCore.App.Analyzers.Infrastructure;
using Microsoft.CodeAnalysis;
using Microsoft.CodeAnalysis.Operations;
-using Microsoft.AspNetCore.Http.RequestDelegateGenerator.StaticRouteHandlerModel.Emitters;
-using Microsoft.AspNetCore.Http.RequestDelegateGenerator.StaticRouteHandlerModel;
+using Microsoft.AspNetCore.Http.RequestDelegateGenerator.StaticRouteHandler.Emitters;
+using Microsoft.AspNetCore.Http.RequestDelegateGenerator.StaticRouteHandler.Model;
using Microsoft.CodeAnalysis.CSharp;
namespace Microsoft.AspNetCore.Http.RequestDelegateGenerator;
@@ -53,126 +53,113 @@ public void Initialize(IncrementalGeneratorInitializationContext context)
var endpoints = endpointsWithDiagnostics
.Where(endpoint => endpoint.Diagnostics.Count == 0)
- .WithTrackingName(GeneratorSteps.EndpointsWithoutDiagnosicsStep);
-
- var thunks = endpoints.Select((endpoint, _) =>
- {
- using var stringWriter = new StringWriter(CultureInfo.InvariantCulture);
- using var codeWriter = new CodeWriter(stringWriter, baseIndent: 3);
- codeWriter.InitializeIndent();
- codeWriter.WriteLine($"[{endpoint.EmitSourceKey()}] = (");
- codeWriter.Indent++;
- codeWriter.WriteLine("(methodInfo, options) =>");
- codeWriter.StartBlock();
- codeWriter.WriteLine(@"Debug.Assert(options != null, ""RequestDelegateFactoryOptions not found."");");
- codeWriter.WriteLine(@"Debug.Assert(options.EndpointBuilder != null, ""EndpointBuilder not found."");");
- codeWriter.WriteLine($"options.EndpointBuilder.Metadata.Add(new SourceKey{endpoint.EmitSourceKey()});");
- endpoint.EmitEndpointMetadataPopulation(codeWriter);
- codeWriter.WriteLine("return new RequestDelegateMetadataResult { EndpointMetadata = options.EndpointBuilder.Metadata.AsReadOnly() };");
- codeWriter.EndBlockWithComma();
- codeWriter.WriteLine("(del, options, inferredMetadataResult) =>");
- codeWriter.StartBlock();
- codeWriter.WriteLine(@"Debug.Assert(options != null, ""RequestDelegateFactoryOptions not found."");");
- codeWriter.WriteLine(@"Debug.Assert(options.EndpointBuilder != null, ""EndpointBuilder not found."");");
- codeWriter.WriteLine(@"Debug.Assert(options.EndpointBuilder.ApplicationServices != null, ""ApplicationServices not found."");");
- codeWriter.WriteLine(@"Debug.Assert(options.EndpointBuilder.FilterFactories != null, ""FilterFactories not found."");");
- codeWriter.WriteLine($"var handler = ({endpoint.EmitHandlerDelegateType(considerOptionality: true)})del;");
- codeWriter.WriteLine("EndpointFilterDelegate? filteredInvocation = null;");
- if (endpoint.EmitterContext.RequiresLoggingHelper || endpoint.EmitterContext.HasJsonBodyOrService || endpoint.Response?.IsSerializableJsonResponse(out var _) is true)
- {
- codeWriter.WriteLine("var serviceProvider = options.ServiceProvider ?? options.EndpointBuilder.ApplicationServices;");
- }
- endpoint.EmitLoggingPreamble(codeWriter);
- endpoint.EmitRouteOrQueryResolver(codeWriter);
- endpoint.EmitJsonBodyOrServiceResolver(codeWriter);
- endpoint.Response?.EmitJsonPreparation(codeWriter);
- if (endpoint.NeedsParameterArray)
- {
- codeWriter.WriteLine("var parameters = del.Method.GetParameters();");
- }
- codeWriter.WriteLineNoTabs(string.Empty);
- codeWriter.WriteLine("if (options.EndpointBuilder.FilterFactories.Count > 0)");
- codeWriter.StartBlock();
- codeWriter.WriteLine(endpoint.Response?.IsAwaitable == true
- ? "filteredInvocation = GeneratedRouteBuilderExtensionsCore.BuildFilterDelegate(async ic =>"
- : "filteredInvocation = GeneratedRouteBuilderExtensionsCore.BuildFilterDelegate(ic =>");
- codeWriter.StartBlock();
- codeWriter.WriteLine("if (ic.HttpContext.Response.StatusCode == 400)");
- codeWriter.StartBlock();
- codeWriter.WriteLine(endpoint.Response?.IsAwaitable == true
- ? "return (object?)Results.Empty;"
- : "return ValueTask.FromResult