* [release/8.0-rc2] [Blazor] Make auto components prefer the existing render mode (#50851)
# Make auto components prefer the existing render mode
Ensures that if interactive components exist on the page and they all use a single render mode, components with the "Auto" render mode will also use that render mode.
## Description
It's a common requirement for state to be shared between interactive root components. For example, the `<HeadOutlet>` component, which allows updating content in the HTML `<head>`, renders content specified by a `<HeadContent>` component, if it exists. However, this only works if the `<HeadOutlet>` and `<HeadContent>` components use the same interactive render mode.
The Auto render mode lets Blazor select a "best" render mode (either Server or WebAssembly) at runtime, primarily depending on whether Blazor WebAssembly resources are cached in the browser. However, previously it did this without taking into consideration the render mode used by existing components on the page.
For example, suppose a `<HeadOutlet>` with an Auto render mode gets added to the page before WebAssembly resources have been loaded and cached, so it uses Blazor Server. Later, a `<HeadContent>` component, also with an Auto render mode, gets added to the page. But at this point, WebAssembly resources have loaded completely, so the `<HeadContent>` component uses Blazor WebAssembly. In this example, the content in the `<head>` does not update, because the `<HeadOutlet>` and `<HeadContent>` use different render modes.
This PR updates the auto render mode decision making logic to the following:
* If WebAssembly components exist on the page, use WebAssembly
* Otherwise, if Server components exist on the page, use Server
* Otherwise, if WebAssembly resources are cached, use WebAssembly
* Otherwise, use Server
Fixes#50686
## Customer Impact
Medium/high. We've seen multiple reports of the existing behavior causing problems in customer apps, and there isn't a workaround.
## Regression?
- [ ] Yes
- [X] No
This behavior has existed since the Auto render mode was introduced in an earlier .NET 8 preview release.
## Risk
- [ ] High
- [ ] Medium
- [X] Low
This PR is a small change to the Auto mode logic. It's unlikely that customers were already relying on the existing behavior.
## Verification
- [X] Manual (required)
- [X] Automated
## Packaging changes reviewed?
- [ ] Yes
- [ ] No
- [X] N/A
* Add Identity Components to Blazor template (#50722)
# Add Identity Components to Blazor template
## Description
This adds the option to add Identity Razor Components (`*.razor` files) when using the Blazor project template. This supports the same feature set as the Identity Razor Pages (`*.cshtml` files). We've already done an accessibility pass over these newly added components and this PR includes all the fixes for Accessibility too. As with the Identity Razor Pages, this supports local authentication (with the option to configure external login providers) and Identity management using EF Core.
Fixes#48786
## Customer Impact
These Identity Razor Components have been a common request for years as noted above, because it allows Blazor developers to use Identity without needing to add Razor Pages infrastructure which would otherwise be unnecessary and doesn't integrate well with the rest of the app. For example, the Identity Razor Pages to a Blazor app would use a different layout that doesn't match the look and feel of the Razor Components that make up the rest of the app.
## Regression?
- [ ] Yes
- [x] No
## Risk
- [ ] High
- [ ] Medium
- [x] Low
These are template only changes that only affect the brand new Blazor project template. It should have no impact on the project template output unless you opt-in to the individual auth option (other than a [small fix](5462e42a63) to make the `--empty` option produce compileable output with all `InteractivityPlatform` options.)
## Verification
- [x] Manual (required)
- [x] Automated
We're also adding new validation scenarios for vendors to validate periodically.
## Packaging changes reviewed?
- [ ] Yes
- [ ] No
- [x] N/A
----
- [x] Finish user management components for 2fa, external login, personal data, etc...
- [x] Add signout link
- [x] Verify RegisterOnPersisting gets invoked as expected with the changes from #50625
- [x] Render ShowRecoveryCodes.razor inline rather than via a redirect.
- [x] Add baseline tests
- [x] Fix BOMs
- [x] Validate the template in VS
* Add logging to Http.Sys tests (#50883)
* Skip failing tests (#50917)
* Avoid re-running routing for implicit middlewares and remove implicit anti-forgery (#50864)
## Description
Avoid running routing eagerly in implicit middlewares to prevents the `EndpointFeature` from being set and causing unexpected reactions in other middlewares, like the static file middleware.
We also remove the implicit registration of the anti-forgery middleware to avoid unintended collisions with authentication in Blazor.
Fixes https://github.com/dotnet/aspnetcore/issues/50818, https://github.com/dotnet/aspnetcore/issues/50815, https://github.com/dotnet/aspnetcore/issues/50844
## Customer Impact
Without this change, the anti-forgery middleware in Blazor apps runs too early and is not able to examine authentication state in the application. Requiring the middleware to be registered explicitly ensures that the correct ordering is applied.
Without this change, users will run into difficult to resolve issues with building applications that include forms with Blazor web apps.
## Regression?
- [X] Yes
- [ ] No
This is a regression that was introduced to middleware routing in .NET 8 Preview 7.
## Risk
- [ ] High
- [X] Medium
- [ ] Low
**Medium risk** because:
- We are reverting a change that was originally applied to resolve https://github.com/dotnet/aspnetcore/issues/49654. This means that the original bug will impact users, specifically those who are calling `UseRouting` explicitly without calling `UseAuthentication` and `UseAuthorization` if they are not available. There is a workaround that we plan to document this behavior for users.
- Apps deployed in .NET 8 RC 1 will break because we no longer automatically enable the anti-forgery middleware. Users will receive an exception at startup notifying them of the code changes to make in order to get things working correctly.
## Verification
- [X] Manual (required)
- [X] Automated
## Packaging changes reviewed?
- [ ] Yes
- [ ] No
- [X] N/A
* [release/8.0] Update dependencies from dotnet/runtime (#50957)
* Update dependencies from https://github.com/dotnet/runtime build 20230926.15
Microsoft.Bcl.AsyncInterfaces , Microsoft.Bcl.TimeProvider , Microsoft.Extensions.Caching.Abstractions , Microsoft.Extensions.Caching.Memory , Microsoft.Extensions.Configuration , Microsoft.Extensions.Configuration.Abstractions , Microsoft.Extensions.Configuration.Binder , Microsoft.Extensions.Configuration.CommandLine , Microsoft.Extensions.Configuration.EnvironmentVariables , Microsoft.Extensions.Configuration.FileExtensions , Microsoft.Extensions.Configuration.Ini , Microsoft.Extensions.Configuration.Json , Microsoft.Extensions.Configuration.UserSecrets , Microsoft.Extensions.Configuration.Xml , Microsoft.Extensions.DependencyInjection , Microsoft.Extensions.DependencyInjection.Abstractions , Microsoft.Extensions.DependencyModel , Microsoft.Extensions.Diagnostics , Microsoft.Extensions.Diagnostics.Abstractions , Microsoft.Extensions.FileProviders.Abstractions , Microsoft.Extensions.FileProviders.Composite , Microsoft.Extensions.FileProviders.Physical , Microsoft.Extensions.FileSystemGlobbing , Microsoft.Extensions.HostFactoryResolver.Sources , Microsoft.Extensions.Hosting , Microsoft.Extensions.Hosting.Abstractions , Microsoft.Extensions.Http , Microsoft.Extensions.Logging , Microsoft.Extensions.Logging.Abstractions , Microsoft.Extensions.Logging.Configuration , Microsoft.Extensions.Logging.Console , Microsoft.Extensions.Logging.Debug , Microsoft.Extensions.Logging.EventLog , Microsoft.Extensions.Logging.EventSource , Microsoft.Extensions.Logging.TraceSource , Microsoft.Extensions.Options , Microsoft.Extensions.Options.ConfigurationExtensions , Microsoft.Extensions.Options.DataAnnotations , Microsoft.Extensions.Primitives , Microsoft.Internal.Runtime.AspNetCore.Transport , Microsoft.NET.Runtime.MonoAOTCompiler.Task , Microsoft.NET.Runtime.WebAssembly.Sdk , Microsoft.NETCore.App.Ref , Microsoft.NETCore.App.Runtime.AOT.win-x64.Cross.browser-wasm , Microsoft.NETCore.App.Runtime.win-x64 , Microsoft.NETCore.BrowserDebugHost.Transport , Microsoft.NETCore.Platforms , System.Collections.Immutable , System.Composition , System.Configuration.ConfigurationManager , System.Diagnostics.DiagnosticSource , System.Diagnostics.EventLog , System.Diagnostics.PerformanceCounter , System.DirectoryServices.Protocols , System.IO.Hashing , System.IO.Pipelines , System.Net.Http.Json , System.Net.Http.WinHttpHandler , System.Reflection.Metadata , System.Resources.Extensions , System.Runtime.Caching , System.Security.Cryptography.Pkcs , System.Security.Cryptography.Xml , System.Security.Permissions , System.ServiceProcess.ServiceController , System.Text.Encodings.Web , System.Text.Json , System.Threading.AccessControl , System.Threading.Channels , System.Threading.RateLimiting , Microsoft.SourceBuild.Intermediate.runtime.linux-x64
From Version 8.0.0-rtm.23475.7 -> To Version 8.0.0-rtm.23476.15
* Update node version
---------
Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
Co-authored-by: jacalvar <jacalvar@microsoft.com>
* [Blazor] Antiforgery fix (#50946)
# Ensure antiforgery token flows to Blazor WebAssembly
The change makes sure that we persist the Antiforgery token during prerendering so that it is available to WebAssembly components.
## Description
* When using cookie authentication it is necessary to use antiforgery protection to prevent cross-site request forgery attacks.
* Blazor Webassembly interactive components must get access to the request antiforgery token to attach it to any outgoing API call.
* The antiforgery request token was not flowing from the server to the client correctly.
* This change enables calling APIs from web assembly to the server safely.
Fixes https://github.com/dotnet/aspnetcore/issues/50900
## Customer Impact
.NET 8.0 customers who have created Blazor Web Apps will fail to call APIs from webassembly components, as they won't be able to attach the required antiforgery token.
## Regression?
- [ ] Yes
- [X] No
[If yes, specify the version the behavior has regressed from]
## Risk
- [ ] High
- [ ] Medium
- [X] Low
The fix is simple and we added an E2E test to cover the scenario.
## Verification
- [ ] Manual (required)
- [X] Automated
## Packaging changes reviewed?
- [ ] Yes
- [ ] No
- [X] N/A
----
## When servicing release/2.1
- [ ] Make necessary changes in eng/PatchConfig.props
* Update dependencies from https://github.com/dotnet/runtime build 20230927.9 (#50977)
Microsoft.Bcl.AsyncInterfaces , Microsoft.Bcl.TimeProvider , Microsoft.Extensions.Caching.Abstractions , Microsoft.Extensions.Caching.Memory , Microsoft.Extensions.Configuration , Microsoft.Extensions.Configuration.Abstractions , Microsoft.Extensions.Configuration.Binder , Microsoft.Extensions.Configuration.CommandLine , Microsoft.Extensions.Configuration.EnvironmentVariables , Microsoft.Extensions.Configuration.FileExtensions , Microsoft.Extensions.Configuration.Ini , Microsoft.Extensions.Configuration.Json , Microsoft.Extensions.Configuration.UserSecrets , Microsoft.Extensions.Configuration.Xml , Microsoft.Extensions.DependencyInjection , Microsoft.Extensions.DependencyInjection.Abstractions , Microsoft.Extensions.DependencyModel , Microsoft.Extensions.Diagnostics , Microsoft.Extensions.Diagnostics.Abstractions , Microsoft.Extensions.FileProviders.Abstractions , Microsoft.Extensions.FileProviders.Composite , Microsoft.Extensions.FileProviders.Physical , Microsoft.Extensions.FileSystemGlobbing , Microsoft.Extensions.HostFactoryResolver.Sources , Microsoft.Extensions.Hosting , Microsoft.Extensions.Hosting.Abstractions , Microsoft.Extensions.Http , Microsoft.Extensions.Logging , Microsoft.Extensions.Logging.Abstractions , Microsoft.Extensions.Logging.Configuration , Microsoft.Extensions.Logging.Console , Microsoft.Extensions.Logging.Debug , Microsoft.Extensions.Logging.EventLog , Microsoft.Extensions.Logging.EventSource , Microsoft.Extensions.Logging.TraceSource , Microsoft.Extensions.Options , Microsoft.Extensions.Options.ConfigurationExtensions , Microsoft.Extensions.Options.DataAnnotations , Microsoft.Extensions.Primitives , Microsoft.Internal.Runtime.AspNetCore.Transport , Microsoft.NET.Runtime.MonoAOTCompiler.Task , Microsoft.NET.Runtime.WebAssembly.Sdk , Microsoft.NETCore.App.Ref , Microsoft.NETCore.App.Runtime.AOT.win-x64.Cross.browser-wasm , Microsoft.NETCore.App.Runtime.win-x64 , Microsoft.NETCore.BrowserDebugHost.Transport , Microsoft.NETCore.Platforms , System.Collections.Immutable , System.Composition , System.Configuration.ConfigurationManager , System.Diagnostics.DiagnosticSource , System.Diagnostics.EventLog , System.Diagnostics.PerformanceCounter , System.DirectoryServices.Protocols , System.IO.Hashing , System.IO.Pipelines , System.Net.Http.Json , System.Net.Http.WinHttpHandler , System.Reflection.Metadata , System.Resources.Extensions , System.Runtime.Caching , System.Security.Cryptography.Pkcs , System.Security.Cryptography.Xml , System.Security.Permissions , System.ServiceProcess.ServiceController , System.Text.Encodings.Web , System.Text.Json , System.Threading.AccessControl , System.Threading.Channels , System.Threading.RateLimiting , Microsoft.SourceBuild.Intermediate.runtime.linux-x64
From Version 8.0.0-rtm.23476.15 -> To Version 8.0.0-rtm.23477.9
Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
---------
Co-authored-by: Mackinnon Buck <mackinnon.buck@gmail.com>
Co-authored-by: Stephen Halter <halter73@gmail.com>
Co-authored-by: Brennan <brecon@microsoft.com>
Co-authored-by: William Godbe <wigodbe@microsoft.com>
Co-authored-by: Safia Abdalla <safia@microsoft.com>
Co-authored-by: dotnet-maestro[bot] <42748379+dotnet-maestro[bot]@users.noreply.github.com>
Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
Co-authored-by: jacalvar <jacalvar@microsoft.com>
* Revert "Remove hardcoded System.Security.Cryptography.Xml version (#48029)" (#50723)
This reverts commit 42d14c4bab.
* [Blazor] Prerendered state (#50742)
[Blazor] Adds support for persting prerendered state on Blazor Web applications.
* Persists state both for server and webassembly as necessary.
* Initializes the state when a given interactive runtime is initialized and renders the first set of components.
* On WebAssembly, this is the first time the app starts.
* On Server this happens every time a circuit starts.
* The state is available during the first render, until the components reach quiescence.
The approach we follow is different for server and webassembly:
* On Server, we support initializing the circuit with an empty set of descriptors and in that case, we delay initialization until the first `UpdateRootComponents` call is issued.
* This is because it's hard to deal with the security constraints imposed by starting a new circuit multiple times, and its easier to handle them within UpdateRootComponents. We might switch this approach in the future to go through `StartCircuit` too.
* On WebAssembly, we query for the initial set of webassembly components when we are starting the runtime in a Blazor Web Scenario.
* We do this because Blazor WebAssembly offers a programatic API to render root components at a given location defined by their selectors, so we need to make sure that those components can receive state at the same time the initial set of WebAssembly components added to the page.
There are a set of tests validating different behaviors with regards to enhanced navigation and streaming rendering, as well as making sure that auto mode can access the state on Server and WebAssembly, and that Server gets new state every time a circuit is opened.
* Make IEmailSender more customizable (#50301)
* Make IEmailSender more customizable
* Remove unnecessary metadata
* Add TUser parameter
* React to API review feedback
* Fix IdentitySample.DefaultUI
* Update branding to RTM (#50799)
---------
Co-authored-by: Igor Velikorossov <RussKie@users.noreply.github.com>
Co-authored-by: Javier Calvarro Nelson <jacalvar@microsoft.com>
Co-authored-by: Stephen Halter <halter73@gmail.com>
Co-authored-by: William Godbe <wigodbe@microsoft.com>
[release/8.0] Update dependencies from dotnet/arcade
- Update EventTest.cs now that Selenium reports the full set of events properly
- Update EventTest.cs
- Quarantine (actually comment out) one of the CanRenderComponentWithPersistedState cases
See https://github.com/dotnet/aspnetcore/issues/50810
- Disable another flaky test
Microsoft.SourceBuild.Intermediate.source-build-reference-packages
From Version 9.0.0-alpha.1.23465.1 -> To Version 9.0.0-alpha.1.23468.3
Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
* Update dependencies from https://github.com/dotnet/source-build-reference-packages build 20230914.1
Microsoft.SourceBuild.Intermediate.source-build-reference-packages
From Version 9.0.0-alpha.1.23463.2 -> To Version 9.0.0-alpha.1.23464.1
* Update dependencies from https://github.com/dotnet/source-build-reference-packages build 20230915.1
Microsoft.SourceBuild.Intermediate.source-build-reference-packages
From Version 9.0.0-alpha.1.23463.2 -> To Version 9.0.0-alpha.1.23465.1
* Update dependencies from https://github.com/dotnet/source-build-reference-packages build 20230915.1
Microsoft.SourceBuild.Intermediate.source-build-reference-packages
From Version 9.0.0-alpha.1.23463.2 -> To Version 9.0.0-alpha.1.23465.1
---------
Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
Microsoft.SourceBuild.Intermediate.source-build-reference-packages
From Version 8.0.0-alpha.1.23462.1 -> To Version 8.0.0-alpha.1.23463.1
Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
Co-authored-by: Igor Velikorossov <RussKie@users.noreply.github.com>
* Update dependencies from https://github.com/dotnet/source-build-reference-packages build 20230907.1
Microsoft.SourceBuild.Intermediate.source-build-reference-packages
From Version 8.0.0-alpha.1.23455.3 -> To Version 8.0.0-alpha.1.23457.1
* Update dependencies from https://github.com/dotnet/source-build-reference-packages build 20230911.1
Microsoft.SourceBuild.Intermediate.source-build-reference-packages
From Version 8.0.0-alpha.1.23457.1 -> To Version 8.0.0-alpha.1.23461.1
* Update dependencies from https://github.com/dotnet/source-build-reference-packages build 20230912.2
Microsoft.SourceBuild.Intermediate.source-build-reference-packages
From Version 8.0.0-alpha.1.23457.1 -> To Version 9.0.0-alpha.1.23462.2
* Update dependencies from https://github.com/dotnet/source-build-reference-packages build 20230913.2
Microsoft.SourceBuild.Intermediate.source-build-reference-packages
From Version 8.0.0-alpha.1.23461.1 -> To Version 9.0.0-alpha.1.23463.2
---------
Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
Co-authored-by: Igor Velikorossov <RussKie@users.noreply.github.com>
* Update dependencies from https://github.com/dotnet/source-build-externals build 20230911.2
Microsoft.SourceBuild.Intermediate.source-build-externals
From Version 8.0.0-alpha.1.23461.1 -> To Version 8.0.0-alpha.1.23461.2
* Update Microsoft.IdentityModel to 7.0.0
* Update dependencies from https://github.com/dotnet/source-build-externals build 20230911.2
Microsoft.SourceBuild.Intermediate.source-build-externals
From Version 8.0.0-alpha.1.23461.1 -> To Version 8.0.0-alpha.1.23461.2
---------
Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
* split SE.Redis OutputCache implementation into new package, Microsoft.AspNetCore.OutputCaching.StackExchangeRedis
(it was causing an undesirable framework ref)
- remove the output cache functionality and ref from Microsoft.Extensions.Caching.StackExchange.Redis
- (simplified API [un]shipped.txt back to single; no change except no more unshipped)
- moved functionality to new package (and update eng files accordingly)
- new namespace etc; will need API review
- in particular, RedisCacheOptions was shared between both APIs; now RedisOutputCacheOptions
* update tags
* add a startvs.cmd
* remove ExcludeFromSourceBuild
* revert shipped/unshipped to make CI happy
* keep public API file position to minimize PR size
* seal RedisOutputCacheOptions
* file named incorrectly
* unnecessary using directive
* remove IOptions<T> from RedisOutputCacheOptions (required using DI in the tests)
Microsoft.SourceBuild.Intermediate.source-build-reference-packages
From Version 8.0.0-alpha.1.23451.1 -> To Version 8.0.0-alpha.1.23455.3
Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
Microsoft.SourceBuild.Intermediate.source-build-externals
From Version 8.0.0-alpha.1.23430.3 -> To Version 8.0.0-alpha.1.23455.1
Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
Microsoft.SourceBuild.Intermediate.source-build-reference-packages
From Version 8.0.0-alpha.1.23424.1 -> To Version 8.0.0-alpha.1.23428.2
Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
* Update Microsoft.Identity.Model to 7.0.0-preview4
* Update dependencies from https://github.com/dotnet/source-build-externals build 20230830.1
Microsoft.SourceBuild.Intermediate.source-build-externals
From Version 8.0.0-alpha.1.23429.1 -> To Version 8.0.0-alpha.1.23430.1
* Update dependencies from https://github.com/dotnet/source-build-externals build 20230830.3
Microsoft.SourceBuild.Intermediate.source-build-externals
From Version 8.0.0-alpha.1.23430.1 -> To Version 8.0.0-alpha.1.23430.3
---------
Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
* Remove reflection from KestrelServer constructor (#50272)
* Update dependencies from https://github.com/dotnet/extensions build 20230822.1 (#50288)
[release/8.0] Update dependencies from dotnet/extensions
* Ensure enhanced nav requests have the correct headers (#50263)
* In SSR, supply HttpContext as cascading value (#50253)
Fixes https://github.com/dotnet/aspnetcore/issues/48769
### Usage
```cs
[CascadingParameter] public HttpContext? Context { get; set; }
```
In SSR, this will receive the `HttpContext`. In other rendering modes where there is no HTTP context, no value will be supplied so the property will remain `null`.
### Alternative design considered
In #48769 I suggested using `[SupplyParameterFromHttpContext]` but that turns out not to be practical unless we either (a) make `ICascadingValueSupplier` public, or (b) add an IVT from `M.A.Components` to `.Endpoints`.
I'm not keen on doing either of the above on a whim. Plus, use of `[CascadingValue]` has advantages:
* It's consistent with the existing pattern for authentication state (we have `[CascadingParameter] Task<AuthenticationState> AuthenticationStateTask { get; set; }`).
* Longer term, if we add more things like this, it would be nice not to add a separate special attribute for each one when `[CascadingParameter]` is already descriptive enough. Special attributes are needed only when the type of thing being supplied might reasonably clash with something else the application is doing (for example, we do need it for form/query, as they supply arbitrary types).
## Review notes
It's best to look at the two commits in this PR completely separately:
1. The first commit fixes an API design problem I discovered while considering how to do this. I realised that when we added `CascadingParameterAttributeBase`, we made a design mistake:
* We put the `Name` property on the abstract base class just because `CascadingParameterAttribute`, `SupplyParameterFromQuery`, and `SupplyParameterFromForm` all have a `Name`.
* However, in all three cases there, the `Name` has completely different meanings. For `CascadingParameterAttribute`, it's the name associated with `<CascadingValue Name=...>`, whereas for form it's the `Request.Form` entry or fall back on property name, and for query it's the `Request.Query` entry or fall back on property name. In general there's no reason why a `CascadingParameterAttributeBase` subclass should have a `Name` at all (`SupplyParameterFromHttpContext` wasn't going to), and if it does have one, its semantics are specific to it. So these should not be the same properties.
* The change we made to make `CascadingParameterAttribute.Name` virtual might even be breaking (see https://learn.microsoft.com/en-us/dotnet/core/compatibility/library-change-rules stating *DISALLOWED: Adding the virtual keyword to a member*). So it's good we can revert that here.
2. The second commit is the completely trivial implementation of supplying `HttpContext` as a cascading value, with an E2E test.
* Fix SSR redirections. Fixes#49670 (#50261)
Fixes#49670 trivially by making `HttpNavigationManager`'s redirection logic consistent with the other `NavigationManager` implementations.
You'll be wondering why there are no E2E tests with this PR. The reason is that, surprisingly, we *already* have E2E tests for these kinds of non-root redirections. However, they were falsely passing, which is tracked by https://github.com/dotnet/aspnetcore/issues/50260 and is outside the scope of this PR. I think we should address that other issue in .NET 9 as there should be no developer/API impact from leaving it as-is for .NET 8.
* API review followups (#50181)
* RazorComponentResult: change namespace, make executor internal, merge test classes
* RazorComponentResult: Nullability and trim annotations
* RazorComponentResult: IStatusCodeHttpResult and IContentTypeHttpResult
* Cleanup
* Further clean up annotations
* Remove HtmlRootComponent.ComponentId as per API review
* Rename SupplyParameterFromFormAttribute.Handler to FormName
* API review: seal
* Clarify RenderModeAttribute inheritance. Fixes#49848
* Rename valueFactory -> initialValueFactory
* Remove unnecessary sequence params
* Make [StreamRendering] default to true
* Support hot reload for Blazor component endpoints (#50031)
* Support hot reload for Blazor component endpoints
* Use alternative navigation exports
* Address feedback
* Make HotReloadService optional
* Address more feedback
* [release/8.0] Update SDK (#50276)
* [release/8.0] Update SDK
* Fix IsAotCompatible warnings
* Update nullability annotation for TemplatePart.Text
* Update CodeGen.proj to account for conditional IsTrimmable metadata
* Update Directory.Build.props.in
---------
Co-authored-by: Stephen Halter <halter73@gmail.com>
* Provide a better error (#50311)
* Remove more setup overhead in RDG benchmarks (#50302)
* Use polling to watch certificate paths (#50251)
* Cache parsable and bindable type info in RDG (#50326)
* Use absolute URLs for confirmation emails (#50297)
This PR updates the MapIdentityApi endpoints that send confirmation emails to use absolute URLs. Previously the emails used relative links which of course do not work for links in emails.
Fixes#50296
* [release/8.0] [Blazor] Close the circuit when all Blazor Server components are disposed (#50170)
# [Blazor] Close the circuit when all Blazor Server components are disposed
Allows a Blazor Server circuit to close when all root Blazor Server components get dynamically removed from the page.
## Description
The overall approach I've taken is:
1. Define what it means for the circuit to be in use (`WebRootComponentManager.hasAnyExistingOrPendingServerComponents()`):
* There are interactive Blazor Server components on the page, or...
* The initialization of an interactive Blazor Server component has started, but hasn't completed yet, or...
* There are SSR'd components on the page that haven't been initialized for interactivity yet (consider stream rendering, where we don't activate new components until the response completes), but they have either a "Server" or "Auto" render mode
2. Determine the cases where a circuit's "in use" status may have changed:
* After a render batch is applied (see `attachCircuitAfterRenderCallback` in `WebRootComponentManager.ts`)
* An applied render batch may result in the creation/disposal of a root component
* After an SSR update occurs, but before the first render batch is applied
* Consider the case where an SSR'd component with a Server render mode gets removed from the page, but before the circuit has a chance to initialize
3. Decide what to do if the "in use" status may have changed (`WebRootComponentManager.circuitMayHaveNoRootComponents()`):
* If the circuit is not in use:
* Start a timeout with some configurable duration (`SsrStartOptions.circuitInactivityTimeoutMs`), if it hasn't started already
* When the timeout expires, dispose the circuit
* If the circuit is not in use:
* Clear any existing timeout
This PR also:
- [X] Addresses a bug preventing Virtualize from working correctly when a WebAssembly and Server instance is present on the page at the same time
- [X] Adds E2E tests
Fixes#48765
* [release/8.0] Update dependencies from dotnet/runtime (#50305)
* Update dependencies from https://github.com/dotnet/runtime build 20230823.11
Microsoft.Bcl.AsyncInterfaces , Microsoft.Bcl.TimeProvider , Microsoft.Extensions.Caching.Abstractions , Microsoft.Extensions.Caching.Memory , Microsoft.Extensions.Configuration , Microsoft.Extensions.Configuration.Abstractions , Microsoft.Extensions.Configuration.Binder , Microsoft.Extensions.Configuration.CommandLine , Microsoft.Extensions.Configuration.EnvironmentVariables , Microsoft.Extensions.Configuration.FileExtensions , Microsoft.Extensions.Configuration.Ini , Microsoft.Extensions.Configuration.Json , Microsoft.Extensions.Configuration.UserSecrets , Microsoft.Extensions.Configuration.Xml , Microsoft.Extensions.DependencyInjection , Microsoft.Extensions.DependencyInjection.Abstractions , Microsoft.Extensions.DependencyModel , Microsoft.Extensions.Diagnostics , Microsoft.Extensions.Diagnostics.Abstractions , Microsoft.Extensions.FileProviders.Abstractions , Microsoft.Extensions.FileProviders.Composite , Microsoft.Extensions.FileProviders.Physical , Microsoft.Extensions.FileSystemGlobbing , Microsoft.Extensions.HostFactoryResolver.Sources , Microsoft.Extensions.Hosting , Microsoft.Extensions.Hosting.Abstractions , Microsoft.Extensions.Http , Microsoft.Extensions.Logging , Microsoft.Extensions.Logging.Abstractions , Microsoft.Extensions.Logging.Configuration , Microsoft.Extensions.Logging.Console , Microsoft.Extensions.Logging.Debug , Microsoft.Extensions.Logging.EventLog , Microsoft.Extensions.Logging.EventSource , Microsoft.Extensions.Logging.TraceSource , Microsoft.Extensions.Options , Microsoft.Extensions.Options.ConfigurationExtensions , Microsoft.Extensions.Options.DataAnnotations , Microsoft.Extensions.Primitives , Microsoft.Internal.Runtime.AspNetCore.Transport , Microsoft.NET.Runtime.MonoAOTCompiler.Task , Microsoft.NET.Runtime.WebAssembly.Sdk , Microsoft.NETCore.App.Ref , Microsoft.NETCore.App.Runtime.AOT.win-x64.Cross.browser-wasm , Microsoft.NETCore.App.Runtime.win-x64 , Microsoft.NETCore.BrowserDebugHost.Transport , Microsoft.NETCore.Platforms , System.Collections.Immutable , System.Composition , System.Configuration.ConfigurationManager , System.Diagnostics.DiagnosticSource , System.Diagnostics.EventLog , System.Diagnostics.PerformanceCounter , System.DirectoryServices.Protocols , System.IO.Hashing , System.IO.Pipelines , System.Net.Http.Json , System.Net.Http.WinHttpHandler , System.Reflection.Metadata , System.Resources.Extensions , System.Runtime.Caching , System.Security.Cryptography.Pkcs , System.Security.Cryptography.Xml , System.Security.Permissions , System.ServiceProcess.ServiceController , System.Text.Encodings.Web , System.Text.Json , System.Threading.AccessControl , System.Threading.Channels , System.Threading.RateLimiting
From Version 8.0.0-rc.2.23418.14 -> To Version 8.0.0-rc.2.23423.11
* Update dependencies from https://github.com/dotnet/runtime build 20230823.5
Microsoft.Bcl.AsyncInterfaces , Microsoft.Bcl.TimeProvider , Microsoft.Extensions.Caching.Abstractions , Microsoft.Extensions.Caching.Memory , Microsoft.Extensions.Configuration , Microsoft.Extensions.Configuration.Abstractions , Microsoft.Extensions.Configuration.Binder , Microsoft.Extensions.Configuration.CommandLine , Microsoft.Extensions.Configuration.EnvironmentVariables , Microsoft.Extensions.Configuration.FileExtensions , Microsoft.Extensions.Configuration.Ini , Microsoft.Extensions.Configuration.Json , Microsoft.Extensions.Configuration.UserSecrets , Microsoft.Extensions.Configuration.Xml , Microsoft.Extensions.DependencyInjection , Microsoft.Extensions.DependencyInjection.Abstractions , Microsoft.Extensions.DependencyModel , Microsoft.Extensions.Diagnostics , Microsoft.Extensions.Diagnostics.Abstractions , Microsoft.Extensions.FileProviders.Abstractions , Microsoft.Extensions.FileProviders.Composite , Microsoft.Extensions.FileProviders.Physical , Microsoft.Extensions.FileSystemGlobbing , Microsoft.Extensions.HostFactoryResolver.Sources , Microsoft.Extensions.Hosting , Microsoft.Extensions.Hosting.Abstractions , Microsoft.Extensions.Http , Microsoft.Extensions.Logging , Microsoft.Extensions.Logging.Abstractions , Microsoft.Extensions.Logging.Configuration , Microsoft.Extensions.Logging.Console , Microsoft.Extensions.Logging.Debug , Microsoft.Extensions.Logging.EventLog , Microsoft.Extensions.Logging.EventSource , Microsoft.Extensions.Logging.TraceSource , Microsoft.Extensions.Options , Microsoft.Extensions.Options.ConfigurationExtensions , Microsoft.Extensions.Options.DataAnnotations , Microsoft.Extensions.Primitives , Microsoft.Internal.Runtime.AspNetCore.Transport , Microsoft.NET.Runtime.MonoAOTCompiler.Task , Microsoft.NET.Runtime.WebAssembly.Sdk , Microsoft.NETCore.App.Ref , Microsoft.NETCore.App.Runtime.AOT.win-x64.Cross.browser-wasm , Microsoft.NETCore.App.Runtime.win-x64 , Microsoft.NETCore.BrowserDebugHost.Transport , Microsoft.NETCore.Platforms , System.Collections.Immutable , System.Composition , System.Configuration.ConfigurationManager , System.Diagnostics.DiagnosticSource , System.Diagnostics.EventLog , System.Diagnostics.PerformanceCounter , System.DirectoryServices.Protocols , System.IO.Hashing , System.IO.Pipelines , System.Net.Http.Json , System.Net.Http.WinHttpHandler , System.Reflection.Metadata , System.Resources.Extensions , System.Runtime.Caching , System.Security.Cryptography.Pkcs , System.Security.Cryptography.Xml , System.Security.Permissions , System.ServiceProcess.ServiceController , System.Text.Encodings.Web , System.Text.Json , System.Threading.AccessControl , System.Threading.Channels , System.Threading.RateLimiting
From Version 8.0.0-rc.2.23418.14 -> To Version 8.0.0-rc.2.23423.5
---------
Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
* Update Version.Details.xml
* Update dependencies from https://github.com/dotnet/source-build-reference-packages build 20230824.1 (#50337)
[release/8.0] Update dependencies from dotnet/source-build-reference-packages
* Update Microsoft.Identity.Model to 7.0.0-preview3 (#50218)
* Update Microsoft.Identity.Model to 7.0.0-preview3
* fixing null refs in WsFed
* Add link to tracking issue.
* Add link to tracking issue.
* Update dependencies from https://github.com/dotnet/source-build-externals build 20230824.1
Microsoft.SourceBuild.Intermediate.source-build-externals
From Version 8.0.0-alpha.1.23421.1 -> To Version 8.0.0-alpha.1.23424.1
* Workaround https://github.com/AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet/issues/2261 in a test.
---------
Co-authored-by: Eric Erhardt <eric.erhardt@microsoft.com>
Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
* Update Versions.props
* Quarantine tests (#50379)
Co-authored-by: Mackinnon Buck <mackinnon.buck@gmail.com>
* [release/8.0] Update dependencies from dotnet/runtime (#50350)
* Update dependencies from https://github.com/dotnet/runtime build 20230825.9
Microsoft.Bcl.AsyncInterfaces , Microsoft.Bcl.TimeProvider , Microsoft.Extensions.Caching.Abstractions , Microsoft.Extensions.Caching.Memory , Microsoft.Extensions.Configuration , Microsoft.Extensions.Configuration.Abstractions , Microsoft.Extensions.Configuration.Binder , Microsoft.Extensions.Configuration.CommandLine , Microsoft.Extensions.Configuration.EnvironmentVariables , Microsoft.Extensions.Configuration.FileExtensions , Microsoft.Extensions.Configuration.Ini , Microsoft.Extensions.Configuration.Json , Microsoft.Extensions.Configuration.UserSecrets , Microsoft.Extensions.Configuration.Xml , Microsoft.Extensions.DependencyInjection , Microsoft.Extensions.DependencyInjection.Abstractions , Microsoft.Extensions.DependencyModel , Microsoft.Extensions.Diagnostics , Microsoft.Extensions.Diagnostics.Abstractions , Microsoft.Extensions.FileProviders.Abstractions , Microsoft.Extensions.FileProviders.Composite , Microsoft.Extensions.FileProviders.Physical , Microsoft.Extensions.FileSystemGlobbing , Microsoft.Extensions.HostFactoryResolver.Sources , Microsoft.Extensions.Hosting , Microsoft.Extensions.Hosting.Abstractions , Microsoft.Extensions.Http , Microsoft.Extensions.Logging , Microsoft.Extensions.Logging.Abstractions , Microsoft.Extensions.Logging.Configuration , Microsoft.Extensions.Logging.Console , Microsoft.Extensions.Logging.Debug , Microsoft.Extensions.Logging.EventLog , Microsoft.Extensions.Logging.EventSource , Microsoft.Extensions.Logging.TraceSource , Microsoft.Extensions.Options , Microsoft.Extensions.Options.ConfigurationExtensions , Microsoft.Extensions.Options.DataAnnotations , Microsoft.Extensions.Primitives , Microsoft.Internal.Runtime.AspNetCore.Transport , Microsoft.NET.Runtime.MonoAOTCompiler.Task , Microsoft.NET.Runtime.WebAssembly.Sdk , Microsoft.NETCore.App.Ref , Microsoft.NETCore.App.Runtime.AOT.win-x64.Cross.browser-wasm , Microsoft.NETCore.App.Runtime.win-x64 , Microsoft.NETCore.BrowserDebugHost.Transport , Microsoft.NETCore.Platforms , System.Collections.Immutable , System.Composition , System.Configuration.ConfigurationManager , System.Diagnostics.DiagnosticSource , System.Diagnostics.EventLog , System.Diagnostics.PerformanceCounter , System.DirectoryServices.Protocols , System.IO.Hashing , System.IO.Pipelines , System.Net.Http.Json , System.Net.Http.WinHttpHandler , System.Reflection.Metadata , System.Resources.Extensions , System.Runtime.Caching , System.Security.Cryptography.Pkcs , System.Security.Cryptography.Xml , System.Security.Permissions , System.ServiceProcess.ServiceController , System.Text.Encodings.Web , System.Text.Json , System.Threading.AccessControl , System.Threading.Channels , System.Threading.RateLimiting
From Version 8.0.0-rc.2.23423.5 -> To Version 8.0.0-rc.2.23425.9
* Update dependencies from https://github.com/dotnet/runtime build 20230826.4
Microsoft.Bcl.AsyncInterfaces , Microsoft.Bcl.TimeProvider , Microsoft.Extensions.Caching.Abstractions , Microsoft.Extensions.Caching.Memory , Microsoft.Extensions.Configuration , Microsoft.Extensions.Configuration.Abstractions , Microsoft.Extensions.Configuration.Binder , Microsoft.Extensions.Configuration.CommandLine , Microsoft.Extensions.Configuration.EnvironmentVariables , Microsoft.Extensions.Configuration.FileExtensions , Microsoft.Extensions.Configuration.Ini , Microsoft.Extensions.Configuration.Json , Microsoft.Extensions.Configuration.UserSecrets , Microsoft.Extensions.Configuration.Xml , Microsoft.Extensions.DependencyInjection , Microsoft.Extensions.DependencyInjection.Abstractions , Microsoft.Extensions.DependencyModel , Microsoft.Extensions.Diagnostics , Microsoft.Extensions.Diagnostics.Abstractions , Microsoft.Extensions.FileProviders.Abstractions , Microsoft.Extensions.FileProviders.Composite , Microsoft.Extensions.FileProviders.Physical , Microsoft.Extensions.FileSystemGlobbing , Microsoft.Extensions.HostFactoryResolver.Sources , Microsoft.Extensions.Hosting , Microsoft.Extensions.Hosting.Abstractions , Microsoft.Extensions.Http , Microsoft.Extensions.Logging , Microsoft.Extensions.Logging.Abstractions , Microsoft.Extensions.Logging.Configuration , Microsoft.Extensions.Logging.Console , Microsoft.Extensions.Logging.Debug , Microsoft.Extensions.Logging.EventLog , Microsoft.Extensions.Logging.EventSource , Microsoft.Extensions.Logging.TraceSource , Microsoft.Extensions.Options , Microsoft.Extensions.Options.ConfigurationExtensions , Microsoft.Extensions.Options.DataAnnotations , Microsoft.Extensions.Primitives , Microsoft.Internal.Runtime.AspNetCore.Transport , Microsoft.NET.Runtime.MonoAOTCompiler.Task , Microsoft.NET.Runtime.WebAssembly.Sdk , Microsoft.NETCore.App.Ref , Microsoft.NETCore.App.Runtime.AOT.win-x64.Cross.browser-wasm , Microsoft.NETCore.App.Runtime.win-x64 , Microsoft.NETCore.BrowserDebugHost.Transport , Microsoft.NETCore.Platforms , System.Collections.Immutable , System.Composition , System.Configuration.ConfigurationManager , System.Diagnostics.DiagnosticSource , System.Diagnostics.EventLog , System.Diagnostics.PerformanceCounter , System.DirectoryServices.Protocols , System.IO.Hashing , System.IO.Pipelines , System.Net.Http.Json , System.Net.Http.WinHttpHandler , System.Reflection.Metadata , System.Resources.Extensions , System.Runtime.Caching , System.Security.Cryptography.Pkcs , System.Security.Cryptography.Xml , System.Security.Permissions , System.ServiceProcess.ServiceController , System.Text.Encodings.Web , System.Text.Json , System.Threading.AccessControl , System.Threading.Channels , System.Threading.RateLimiting
From Version 8.0.0-rc.2.23423.5 -> To Version 8.0.0-rc.2.23426.4
---------
Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
* Update Versions.props
---------
Co-authored-by: Stephen Halter <halter73@gmail.com>
Co-authored-by: dotnet-maestro[bot] <42748379+dotnet-maestro[bot]@users.noreply.github.com>
Co-authored-by: Steve Sanderson <SteveSandersonMS@users.noreply.github.com>
Co-authored-by: Safia Abdalla <safia@microsoft.com>
Co-authored-by: Andrew Casey <amcasey@users.noreply.github.com>
Co-authored-by: Mackinnon Buck <mackinnon.buck@gmail.com>
Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
Co-authored-by: jennyf19 <jeferrie@microsoft.com>
Co-authored-by: Eric Erhardt <eric.erhardt@microsoft.com>
Co-authored-by: William Godbe <wigodbe@microsoft.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
* Update Microsoft.Identity.Model to 7.0.0-preview3
* fixing null refs in WsFed
* Add link to tracking issue.
* Add link to tracking issue.
* Update dependencies from https://github.com/dotnet/source-build-externals build 20230824.1
Microsoft.SourceBuild.Intermediate.source-build-externals
From Version 8.0.0-alpha.1.23421.1 -> To Version 8.0.0-alpha.1.23424.1
* Workaround https://github.com/AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet/issues/2261 in a test.
---------
Co-authored-by: Eric Erhardt <eric.erhardt@microsoft.com>
Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
* Update dependencies from https://github.com/dotnet/source-build-reference-packages build 20230821.1
Microsoft.SourceBuild.Intermediate.source-build-reference-packages
From Version 8.0.0-alpha.1.23414.1 -> To Version 8.0.0-alpha.1.23421.1
* Update dependencies from https://github.com/dotnet/source-build-reference-packages build 20230824.1
Microsoft.SourceBuild.Intermediate.source-build-reference-packages
From Version 8.0.0-alpha.1.23421.1 -> To Version 8.0.0-alpha.1.23424.1
---------
Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
Co-authored-by: Mackinnon Buck <mackinnon.buck@gmail.com>
Microsoft.Extensions.Telemetry.Testing
From Version 9.0.0-alpha.1.23416.6 -> To Version 8.0.0-rc.2.23417.1
Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
* Update dependencies from https://github.com/dotnet/arcade build 20230815.4 (#50113)
Microsoft.DotNet.Arcade.Sdk , Microsoft.DotNet.Build.Tasks.Installers , Microsoft.DotNet.Build.Tasks.Templating , Microsoft.DotNet.Helix.Sdk , Microsoft.DotNet.RemoteExecutor
From Version 8.0.0-beta.23411.1 -> To Version 8.0.0-beta.23415.4
Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
* [release/8.0-rc1] [Blazor] Add APIs for "enhanced refresh" (#50124)
* Add NavigationManager.Refresh() + tests
* PR feedback
* Add `forceReload` parameter
---------
Co-authored-by: Mackinnon Buck <mackinnon.buck@gmail.com>
* Support resolving keyed services from DI in RDF and RDG (#50095)
* Support resolving keyed services from DI in RDF and RDG
* Address feedback from peer review
* Support keyed services with different keys but same arg name
---------
Co-authored-by: dotnet-maestro[bot] <42748379+dotnet-maestro[bot]@users.noreply.github.com>
Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Mackinnon Buck <mackinnon.buck@gmail.com>
Co-authored-by: Safia Abdalla <safia@microsoft.com>
Microsoft.SourceBuild.Intermediate.symreader
From Version 2.0.0-beta-23228-03 -> To Version 2.1.0-beta.23409.1
Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
System.Drawing.Common
From Version 8.0.0-rc.1.23408.5 -> To Version 8.0.0-rc.1.23411.1
Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
Co-authored-by: Chris Ross <Tratcher@Outlook.com>