Add AddOptions to AddAuthorizationCore (#18911)
Fixes: #18471 AddAuthorizationCore previously assumed that options were already registered. This isn't the case in 5.0 in Blazor WASM. We don't want Blazor to register options in the default host because it prevents options from being linked out. note: we will have some remaining work for this issue after this change is merged. The Blazor WASM hosting changes haven't landed in master yet, so we'll need to update that code to remove options from the host.
This commit is contained in:
parent
950fa4b010
commit
1360d6559e
|
|
@ -25,6 +25,10 @@ namespace Microsoft.Extensions.DependencyInjection
|
|||
throw new ArgumentNullException(nameof(services));
|
||||
}
|
||||
|
||||
// These services depend on options, and they are used in Blazor WASM, where options
|
||||
// aren't included by default.
|
||||
services.AddOptions();
|
||||
|
||||
services.TryAdd(ServiceDescriptor.Transient<IAuthorizationService, DefaultAuthorizationService>());
|
||||
services.TryAdd(ServiceDescriptor.Transient<IAuthorizationPolicyProvider, DefaultAuthorizationPolicyProvider>());
|
||||
services.TryAdd(ServiceDescriptor.Transient<IAuthorizationHandlerProvider, DefaultAuthorizationHandlerProvider>());
|
||||
|
|
|
|||
|
|
@ -0,0 +1,7 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||
repo_root="$DIR/../.."
|
||||
"$repo_root/build.sh" --projects "$DIR/**/*.*proj" "$@"
|
||||
Loading…
Reference in New Issue