Skip to content

ConfigurationBindingGenerator binding fails without error #115560

Open
@Kumima

Description

@Kumima

Description

When using the ConfigurationBindingGenerator for MicrosoftIdentityOptions from Microsoft.Identity.Web, the binding does not work. There are warning level messages but no error level messages.

To remove the <EnableConfigurationBindingGenerator>true</EnableConfigurationBindingGenerator>, things work. So I think it causes by this source generator mode.

Code

builder.Services.AddAuthentication(OpenIdConnectDefaults.AuthenticationScheme)
    .AddMicrosoftIdentityWebApp(
        options => builder.Configuration.GetRequiredSection(nameof(MicrosoftIdentityOptions)).Bind(options))
// As an example options.AccessDeniedPath fails binding

Warning Log

~: warning SYSLIB1100: Cannot create instance of type 'Microsoft.IdentityModel.Protocols.IConfigurationManager<OpenIdConnectConfiguration>' because it is missing a public instance constructor. (https://learn.microsoft.com/dotnet/fundamentals/syslib-diagnostics/syslib1100)
~: warning SYSLIB1101: Property 'ConfigurationManager' on type 'Microsoft.Identity.Web.MicrosoftIdentityOptions' is not supported. (https://learn.microsoft.com/dotnet/fundamentals/syslib-diagnostics/syslib1101)
~: warning SYSLIB1100: Cannot create instance of type 'Microsoft.AspNetCore.Authentication.ISecureDataFormat<AuthenticationProperties>' because it is missing a public instance constructor. (https://learn.microsoft.com/dotnet/fundamentals/syslib-diagnostics/syslib1100)
~: warning SYSLIB1101: Property 'StateDataFormat' on type 'Microsoft.Identity.Web.MicrosoftIdentityOptions' is not supported. (https://learn.microsoft.com/dotnet/fundamentals/syslib-diagnostics/syslib1101)
~: warning SYSLIB1100: Cannot create instance of type 'Microsoft.AspNetCore.Authentication.ISecureDataFormat<string>' because it is missing a public instance constructor. (https://learn.microsoft.com/dotnet/fundamentals/syslib-diagnostics/syslib1100)
~: warning SYSLIB1101: Property 'StringDataFormat' on type 'Microsoft.Identity.Web.MicrosoftIdentityOptions' is not supported. (https://learn.microsoft.com/dotnet/fundamentals/syslib-diagnostics/syslib1101)
~: warning SYSLIB1100: Cannot create instance of type 'Microsoft.IdentityModel.Tokens.ISecurityTokenValidator' because it is missing a public instance constructor. (https://learn.microsoft.com/dotnet/fundamentals/syslib-diagnostics/syslib1100)
~: warning SYSLIB1101: Property 'SecurityTokenValidator' on type 'Microsoft.Identity.Web.MicrosoftIdentityOptions' is not supported. (https://learn.microsoft.com/dotnet/fundamentals/syslib-diagnostics/syslib1101)
~: warning SYSLIB1100: Cannot create instance of type 'Microsoft.IdentityModel.Tokens.TokenHandler' because it is missing a public instance constructor. (https://learn.microsoft.com/dotnet/fundamentals/syslib-diagnostics/syslib1100)
~: warning SYSLIB1101: Property 'TokenHandler' on type 'Microsoft.Identity.Web.MicrosoftIdentityOptions' is not supported. (https://learn.microsoft.com/dotnet/fundamentals/syslib-diagnostics/syslib1101)
~: warning SYSLIB1100: Cannot create instance of type 'System.Net.Http.HttpMessageHandler' because it is missing a public instance constructor. (https://learn.microsoft.com/dotnet/fundamentals/syslib-diagnostics/syslib1100)
~: warning SYSLIB1101: Property 'BackchannelHttpHandler' on type 'Microsoft.Identity.Web.MicrosoftIdentityOptions' is not supported. (https://learn.microsoft.com/dotnet/fundamentals/syslib-diagnostics/syslib1101)
~: warning SYSLIB1100: Cannot create instance of type 'Microsoft.AspNetCore.DataProtection.IDataProtectionProvider' because it is missing a public instance constructor. (https://learn.microsoft.com/dotnet/fundamentals/syslib-diagnostics/syslib1100)
~: warning SYSLIB1101: Property 'DataProtectionProvider' on type 'Microsoft.Identity.Web.MicrosoftIdentityOptions' is not supported. (https://learn.microsoft.com/dotnet/fundamentals/syslib-diagnostics/syslib1101)
~: warning SYSLIB1100: Cannot create instance of type 'System.TimeProvider' because it is missing a public instance constructor. (https://learn.microsoft.com/dotnet/fundamentals/syslib-diagnostics/syslib1100)
~: warning SYSLIB1101: Property 'TimeProvider' on type 'Microsoft.Identity.Web.MicrosoftIdentityOptions' is not supported. (https://learn.microsoft.com/dotnet/fundamentals/syslib-diagnostics/syslib1101)
~: warning SYSLIB1100: Cannot create instance of type 'Microsoft.AspNetCore.Authentication.OAuth.Claims.ClaimAction' because it is missing a public instance constructor. (https://learn.microsoft.com/dotnet/fundamentals/syslib-diagnostics/syslib1100)
~: warning SYSLIB1100: The collection element type is not supported: 'Microsoft.AspNetCore.Authentication.OAuth.Claims.ClaimActionCollection'. (https://learn.microsoft.com/dotnet/fundamentals/syslib-diagnostics/syslib1100)
~: warning SYSLIB1101: Property 'ClaimActions' on type 'Microsoft.Identity.Web.MicrosoftIdentityOptions' is not supported. (https://learn.microsoft.com/dotnet/fundamentals/syslib-diagnostics/syslib1101)
~: warning SYSLIB1100: Cannot create instance of type 'Microsoft.IdentityModel.Tokens.BaseConfigurationManager' because it is missing a public instance constructor. (https://learn.microsoft.com/dotnet/fundamentals/syslib-diagnostics/syslib1100)
~: warning SYSLIB1101: Property 'ConfigurationManager' on type 'Microsoft.IdentityModel.Tokens.TokenValidationParameters' is not supported. (https://learn.microsoft.com/dotnet/fundamentals/syslib-diagnostics/syslib1101)
~: warning SYSLIB1101: Property 'TokenValidationParameters' on type 'Microsoft.Identity.Web.MicrosoftIdentityOptions' is not supported. (https://learn.microsoft.com/dotnet/fundamentals/syslib-diagnostics/syslib1101)
~: warning SYSLIB1100: Cannot create instance of type 'Microsoft.IdentityModel.Tokens.SecurityKey' because it is missing a public instance constructor. (https://learn.microsoft.com/dotnet/fundamentals/syslib-diagnostics/syslib1100)
~: warning SYSLIB1101: Property 'IssuerSigningKey' on type 'Microsoft.IdentityModel.Tokens.TokenValidationParameters' is not supported. (https://learn.microsoft.com/dotnet/fundamentals/syslib-diagnostics/syslib1101)
~: warning SYSLIB1100: Cannot create instance of type 'Microsoft.IdentityModel.Tokens.ITokenReplayCache' because it is missing a public instance constructor. (https://learn.microsoft.com/dotnet/fundamentals/syslib-diagnostics/syslib1100)
~: warning SYSLIB1101: Property 'TokenReplayCache' on type 'Microsoft.IdentityModel.Tokens.TokenValidationParameters' is not supported. (https://learn.microsoft.com/dotnet/fundamentals/syslib-diagnostics/syslib1101)
~: warning SYSLIB1100: Cannot create instance of type 'System.Net.IWebProxy' because it is missing a public instance constructor. (https://learn.microsoft.com/dotnet/fundamentals/syslib-diagnostics/syslib1100)
~: warning SYSLIB1101: Property 'DefaultProxy' on type 'System.Net.Http.HttpClient' is not supported. (https://learn.microsoft.com/dotnet/fundamentals/syslib-diagnostics/syslib1101)
~: warning SYSLIB1101: Property 'Backchannel' on type 'Microsoft.Identity.Web.MicrosoftIdentityOptions' is not supported. (https://learn.microsoft.com/dotnet/fundamentals/syslib-diagnostics/syslib1101)
~: warning SYSLIB1100: Cannot create instance of type 'System.Net.Http.Headers.HttpRequestHeaders' because it is missing a public instance constructor. (https://learn.microsoft.com/dotnet/fundamentals/syslib-diagnostics/syslib1100)
~: warning SYSLIB1101: Property 'DefaultRequestHeaders' on type 'System.Net.Http.HttpClient' is not supported. (https://learn.microsoft.com/dotnet/fundamentals/syslib-diagnostics/syslib1101)
~: warning SYSLIB1100: Cannot create instance of type 'System.TimeZoneInfo' because it is missing a public instance constructor. (https://learn.microsoft.com/dotnet/fundamentals/syslib-diagnostics/syslib1100)
~: warning SYSLIB1101: Property 'LocalTimeZone' on type 'System.TimeProvider' is not supported. (https://learn.microsoft.com/dotnet/fundamentals/syslib-diagnostics/syslib1101)
~: warning SYSLIB1100: Cannot create instance of type 'Microsoft.IdentityModel.Tokens.CryptoProviderCache' because it is missing a public instance constructor. (https://learn.microsoft.com/dotnet/fundamentals/syslib-diagnostics/syslib1100)
~: warning SYSLIB1101: Property 'CryptoProviderCache' on type 'Microsoft.IdentityModel.Tokens.CryptoProviderFactory' is not supported. (https://learn.microsoft.com/dotnet/fundamentals/syslib-diagnostics/syslib1101)
~: warning SYSLIB1101: Property 'CryptoProviderFactory' on type 'Microsoft.IdentityModel.Protocols.OpenIdConnect.OpenIdConnectProtocolValidator' is not supported. (https://learn.microsoft.com/dotnet/fundamentals/syslib-diagnostics/syslib1101)
~: warning SYSLIB1101: Property 'ProtocolValidator' on type 'Microsoft.Identity.Web.MicrosoftIdentityOptions' is not supported. (https://learn.microsoft.com/dotnet/fundamentals/syslib-diagnostics/syslib1101)
~: warning SYSLIB1100: Cannot create instance of type 'Microsoft.IdentityModel.Tokens.ICryptoProvider' because it is missing a public instance constructor. (https://learn.microsoft.com/dotnet/fundamentals/syslib-diagnostics/syslib1100)
~: warning SYSLIB1101: Property 'CustomCryptoProvider' on type 'Microsoft.IdentityModel.Tokens.CryptoProviderFactory' is not supported. (https://learn.microsoft.com/dotnet/fundamentals/syslib-diagnostics/syslib1101)
~: warning SYSLIB1100: Cannot create instance of type 'Microsoft.IdentityModel.Tokens.BaseConfiguration' because it is missing a public instance constructor. (https://learn.microsoft.com/dotnet/fundamentals/syslib-diagnostics/syslib1100)
~: warning SYSLIB1101: Property 'LastKnownGoodConfiguration' on type 'Microsoft.IdentityModel.Tokens.BaseConfigurationManager' is not supported. (https://learn.microsoft.com/dotnet/fundamentals/syslib-diagnostics/syslib1101)
~: warning SYSLIB1100: Cannot create instance of type 'System.Net.ICredentials' because it is missing a public instance constructor. (https://learn.microsoft.com/dotnet/fundamentals/syslib-diagnostics/syslib1100)
~: warning SYSLIB1101: Property 'Credentials' on type 'System.Net.IWebProxy' is not supported. (https://learn.microsoft.com/dotnet/fundamentals/syslib-diagnostics/syslib1101)
~: warning SYSLIB1100: The collection type is not supported: 'System.Net.Http.Headers.HttpHeaderValueCollection<MediaTypeWithQualityHeaderValue>'. (https://learn.microsoft.com/dotnet/fundamentals/syslib-diagnostics/syslib1100)
~: warning SYSLIB1101: Property 'Accept' on type 'System.Net.Http.Headers.HttpRequestHeaders' is not supported. (https://learn.microsoft.com/dotnet/fundamentals/syslib-diagnostics/syslib1101)
~: warning SYSLIB1100: The collection type is not supported: 'System.Net.Http.Headers.HttpHeaderValueCollection<StringWithQualityHeaderValue>'. (https://learn.microsoft.com/dotnet/fundamentals/syslib-diagnostics/syslib1100)
~: warning SYSLIB1101: Property 'AcceptCharset' on type 'System.Net.Http.Headers.HttpRequestHeaders' is not supported. (https://learn.microsoft.com/dotnet/fundamentals/syslib-diagnostics/syslib1101)
~: warning SYSLIB1100: Cannot create instance of type 'System.Net.Http.Headers.AuthenticationHeaderValue' because it has multiple public parameterized constructors. (https://learn.microsoft.com/dotnet/fundamentals/syslib-diagnostics/syslib1100)
~: warning SYSLIB1101: Property 'Authorization' on type 'System.Net.Http.Headers.HttpRequestHeaders' is not supported. (https://learn.microsoft.com/dotnet/fundamentals/syslib-diagnostics/syslib1101)
~: warning SYSLIB1100: The collection type is not supported: 'System.Net.Http.Headers.HttpHeaderValueCollection<string>'. (https://learn.microsoft.com/dotnet/fundamentals/syslib-diagnostics/syslib1100)
~: warning SYSLIB1101: Property 'Connection' on type 'System.Net.Http.Headers.HttpRequestHeaders' is not supported. (https://learn.microsoft.com/dotnet/fundamentals/syslib-diagnostics/syslib1101)
~: warning SYSLIB1100: The collection type is not supported: 'System.Net.Http.Headers.HttpHeaderValueCollection<NameValueWithParametersHeaderValue>'. (https://learn.microsoft.com/dotnet/fundamentals/syslib-diagnostics/syslib1100)
~: warning SYSLIB1101: Property 'Expect' on type 'System.Net.Http.Headers.HttpRequestHeaders' is not supported. (https://learn.microsoft.com/dotnet/fundamentals/syslib-diagnostics/syslib1101)
~: warning SYSLIB1100: The collection type is not supported: 'System.Net.Http.Headers.HttpHeaderValueCollection<EntityTagHeaderValue>'. (https://learn.microsoft.com/dotnet/fundamentals/syslib-diagnostics/syslib1100)
~: warning SYSLIB1101: Property 'IfMatch' on type 'System.Net.Http.Headers.HttpRequestHeaders' is not supported. (https://learn.microsoft.com/dotnet/fundamentals/syslib-diagnostics/syslib1101)
~: warning SYSLIB1100: Cannot create instance of type 'System.Net.Http.Headers.RangeConditionHeaderValue' because it has multiple public parameterized constructors. (https://learn.microsoft.com/dotnet/fundamentals/syslib-diagnostics/syslib1100)
~: warning SYSLIB1101: Property 'IfRange' on type 'System.Net.Http.Headers.HttpRequestHeaders' is not supported. (https://learn.microsoft.com/dotnet/fundamentals/syslib-diagnostics/syslib1101)
~: warning SYSLIB1100: The collection type is not supported: 'System.Net.Http.Headers.HttpHeaderValueCollection<NameValueHeaderValue>'. (https://learn.microsoft.com/dotnet/fundamentals/syslib-diagnostics/syslib1100)
~: warning SYSLIB1101: Property 'Pragma' on type 'System.Net.Http.Headers.HttpRequestHeaders' is not supported. (https://learn.microsoft.com/dotnet/fundamentals/syslib-diagnostics/syslib1101)
~: warning SYSLIB1100: The collection type is not supported: 'System.Net.Http.Headers.HttpHeaderValueCollection<TransferCodingWithQualityHeaderValue>'. (https://learn.microsoft.com/dotnet/fundamentals/syslib-diagnostics/syslib1100)
~: warning SYSLIB1101: Property 'TE' on type 'System.Net.Http.Headers.HttpRequestHeaders' is not supported. (https://learn.microsoft.com/dotnet/fundamentals/syslib-diagnostics/syslib1101)
~: warning SYSLIB1100: The collection type is not supported: 'System.Net.Http.Headers.HttpHeaderValueCollection<TransferCodingHeaderValue>'. (https://learn.microsoft.com/dotnet/fundamentals/syslib-diagnostics/syslib1100)
~: warning SYSLIB1101: Property 'TransferEncoding' on type 'System.Net.Http.Headers.HttpRequestHeaders' is not supported. (https://learn.microsoft.com/dotnet/fundamentals/syslib-diagnostics/syslib1101)
~: warning SYSLIB1100: The collection type is not supported: 'System.Net.Http.Headers.HttpHeaderValueCollection<ProductHeaderValue>'. (https://learn.microsoft.com/dotnet/fundamentals/syslib-diagnostics/syslib1100)
~: warning SYSLIB1101: Property 'Upgrade' on type 'System.Net.Http.Headers.HttpRequestHeaders' is not supported. (https://learn.microsoft.com/dotnet/fundamentals/syslib-diagnostics/syslib1101)
~: warning SYSLIB1100: The collection type is not supported: 'System.Net.Http.Headers.HttpHeaderValueCollection<ProductInfoHeaderValue>'. (https://learn.microsoft.com/dotnet/fundamentals/syslib-diagnostics/syslib1100)
~: warning SYSLIB1101: Property 'UserAgent' on type 'System.Net.Http.Headers.HttpRequestHeaders' is not supported. (https://learn.microsoft.com/dotnet/fundamentals/syslib-diagnostics/syslib1101)
~: warning SYSLIB1100: The collection type is not supported: 'System.Net.Http.Headers.HttpHeaderValueCollection<ViaHeaderValue>'. (https://learn.microsoft.com/dotnet/fundamentals/syslib-diagnostics/syslib1100)
~: warning SYSLIB1101: Property 'Via' on type 'System.Net.Http.Headers.HttpRequestHeaders' is not supported. (https://learn.microsoft.com/dotnet/fundamentals/syslib-diagnostics/syslib1101)
~: warning SYSLIB1100: The collection type is not supported: 'System.Net.Http.Headers.HttpHeaderValueCollection<WarningHeaderValue>'. (https://learn.microsoft.com/dotnet/fundamentals/syslib-diagnostics/syslib1100)
~: warning SYSLIB1101: Property 'Warning' on type 'System.Net.Http.Headers.HttpRequestHeaders' is not supported. (https://learn.microsoft.com/dotnet/fundamentals/syslib-diagnostics/syslib1101)
~: warning SYSLIB1100: Cannot create instance of type 'System.Security.Cryptography.X509Certificates.X500DistinguishedName' because it has multiple public parameterized constructors. (https://learn.microsoft.com/dotnet/fundamentals/syslib-diagnostics/syslib1100)
~: warning SYSLIB1101: Property 'IssuerName' on type 'System.Security.Cryptography.X509Certificates.X509Certificate2' is not supported. (https://learn.microsoft.com/dotnet/fundamentals/syslib-diagnostics/syslib1101)
~: warning SYSLIB1101: Property 'Certificate' on type 'Microsoft.Identity.Web.CertificateDescription' is not supported. (https://learn.microsoft.com/dotnet/fundamentals/syslib-diagnostics/syslib1101)
~: warning SYSLIB1100: The collection element type is not supported: 'System.Collections.Generic.IEnumerable<CertificateDescription>'. (https://learn.microsoft.com/dotnet/fundamentals/syslib-diagnostics/syslib1100)
~: warning SYSLIB1101: Property 'ClientCertificates' on type 'Microsoft.Identity.Web.MicrosoftIdentityOptions' is not supported. (https://learn.microsoft.com/dotnet/fundamentals/syslib-diagnostics/syslib1101)
~: warning SYSLIB1100: Cannot create instance of type 'System.Security.Cryptography.AsymmetricAlgorithm' because it is missing a public instance constructor. (https://learn.microsoft.com/dotnet/fundamentals/syslib-diagnostics/syslib1100)
~: warning SYSLIB1101: Property 'PrivateKey' on type 'System.Security.Cryptography.X509Certificates.X509Certificate2' is not supported. (https://learn.microsoft.com/dotnet/fundamentals/syslib-diagnostics/syslib1101)
~: warning SYSLIB1100: Cannot create instance of type 'System.Security.Cryptography.X509Certificates.PublicKey' because it has multiple public parameterized constructors. (https://learn.microsoft.com/dotnet/fundamentals/syslib-diagnostics/syslib1100)
~: warning SYSLIB1101: Property 'PublicKey' on type 'System.Security.Cryptography.X509Certificates.X509Certificate2' is not supported. (https://learn.microsoft.com/dotnet/fundamentals/syslib-diagnostics/syslib1101)
~: warning SYSLIB1100: Cannot create instance of type 'System.Net.Http.Headers.EntityTagHeaderValue' because it has multiple public parameterized constructors. (https://learn.microsoft.com/dotnet/fundamentals/syslib-diagnostics/syslib1100)
~: warning SYSLIB1101: Property 'EntityTag' on type 'System.Net.Http.Headers.RangeConditionHeaderValue' is not supported. (https://learn.microsoft.com/dotnet/fundamentals/syslib-diagnostics/syslib1101)
~: warning SYSLIB1100: Cannot create instance of type 'System.Security.Cryptography.X509Certificates.X509Extension' because it has multiple public parameterized constructors. (https://learn.microsoft.com/dotnet/fundamentals/syslib-diagnostics/syslib1100)
~: warning SYSLIB1100: The collection element type is not supported: 'System.Security.Cryptography.X509Certificates.X509ExtensionCollection'. (https://learn.microsoft.com/dotnet/fundamentals/syslib-diagnostics/syslib1100)
~: warning SYSLIB1101: Property 'Extensions' on type 'System.Security.Cryptography.X509Certificates.X509Certificate2' is not supported. (https://learn.microsoft.com/dotnet/fundamentals/syslib-diagnostics/syslib1101)
~: warning SYSLIB1100: Cannot create instance of type 'System.Security.Cryptography.AsnEncodedData' because it has multiple public parameterized constructors. (https://learn.microsoft.com/dotnet/fundamentals/syslib-diagnostics/syslib1100)
~: warning SYSLIB1101: Property 'EncodedKeyValue' on type 'System.Security.Cryptography.X509Certificates.PublicKey' is not supported. (https://learn.microsoft.com/dotnet/fundamentals/syslib-diagnostics/syslib1101)
~: warning SYSLIB1100: Cannot create instance of type 'System.Net.Http.Headers.NameValueHeaderValue' because it has multiple public parameterized constructors. (https://learn.microsoft.com/dotnet/fundamentals/syslib-diagnostics/syslib1100)
~: warning SYSLIB1100: The collection element type is not supported: 'System.Collections.Generic.ICollection<NameValueHeaderValue>'. (https://learn.microsoft.com/dotnet/fundamentals/syslib-diagnostics/syslib1100)
~: warning SYSLIB1101: Property 'Extensions' on type 'System.Net.Http.Headers.CacheControlHeaderValue' is not supported. (https://learn.microsoft.com/dotnet/fundamentals/syslib-diagnostics/syslib1101)
~: warning SYSLIB1101: Property 'CacheControl' on type 'System.Net.Http.Headers.HttpRequestHeaders' is not supported. (https://learn.microsoft.com/dotnet/fundamentals/syslib-diagnostics/syslib1101)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions