Nota
El acceso a esta página requiere autorización. Puede intentar iniciar sesión o cambiar directorios.
El acceso a esta página requiere autorización. Puede intentar cambiar los directorios.
A partir de ASP.NET Core 5.0, se han aplicado anotaciones de nulabilidad a partes del código. Desde el principio de este esfuerzo, se esperaban errores en estas anotaciones y las correcciones tendrían que realizarse. En ASP.NET Core 6.0, se actualizan algunas anotaciones aplicadas anteriormente. Algunos de estos cambios se consideran cambios importantes en el origen. Los cambios provocan que las API sean incompatibles o más restrictivas. Las API actualizadas pueden dar lugar a advertencias en tiempo de compilación cuando se usan en proyectos que tienen habilitados tipos de referencia que aceptan valores NULL.
Para obtener información, consulte Problema de GitHub dotnet/aspnetcore#27564.
Versión introducida
ASP.NET Core 6.0
Comportamiento anterior
Las API afectadas tienen anotaciones de tipo de referencia que aceptan valores NULL incorrectas. Las advertencias de compilación faltan o son incorrectas.
Nuevo comportamiento
Se generan nuevas advertencias de compilación. Las advertencias de compilación incorrectas ya no se generan para las API afectadas.
Motivo del cambio
Mediante comentarios y pruebas adicionales, se determinó que las anotaciones de nulabilidad para las API afectadas eran inexactas. Las anotaciones actualizadas ahora representan correctamente los contratos de nulabilidad para las API.
Acción recomendada
Actualice el código que llama a estas API para reflejar los contratos de nulabilidad revisados.
Las APIs afectadas
- ParameterView.FromDictionary
- Renderer.DispatchEventAsync
- RenderTreeEdit.RemovedAttributeName
- AuthenticationSchemeOptions.ForwardDefaultSelector
- RangeConditionHeaderValue.RangeConditionHeaderValue
- IConnectionListener.AcceptAsync
- IApplicationDiscriminator.Discriminator
- DataProtectionOptions.ApplicationDiscriminator
- AuthenticatedEncryptorFactory.CreateEncryptorInstance
- CngCbcAuthenticatedEncryptorFactory.CreateEncryptorInstance
- CngGcmAuthenticatedEncryptorFactory.CreateEncryptorInstance
- IAuthenticatedEncryptorFactory.CreateEncryptorInstance
- ManagedAuthenticatedEncryptorFactory.CreateEncryptorInstance
- IKey.CreateEncryptor
- KeyManagementOptions.AuthenticatedEncryptorConfiguration
- KeyManagementOptions.XmlEncryptor
- KeyManagementOptions.XmlRepository
- ICertificateResolver.ResolveCertificate
- DataProtectionUtilityExtensions.GetApplicationUniqueIdentifier
- FileSystemXmlRepository.DefaultKeyStorageDirectory
- RegistryXmlRepository.DefaultRegistryKey
- CertificateResolver.ResolveCertificate
- Endpoint.Endpoint
- Endpoint.RequestDelegate
- RouteValueDictionary.TryAdd
- LinkGenerator.GetUriByAddress
- IFeatureCollection.Set
- FeatureCollection.Set
- IFeatureCollection.Get
- ITicketStore.RetrieveAsync
- IFeatureCollection.Get<TFeature>()
- IFeatureCollection.Set<TFeature>(TFeature)
- FeatureCollection.Set<TFeature>(TFeature)
- ModelStateDictionary.SetModelValue(String, Object, String)
- ModelStateDictionary.Item[String]
- ClientValidatorItem.ClientValidatorItem
- ClientValidatorItem.Validator
- Endpoint.Endpoint
- RouteValueDictionary.TryAdd(String, Object)>
- LinkGenerator.GetUriByAddress<TAddress>(TAddress, RouteValueDictionary, String, HostString, PathString, FragmentString, LinkOptions)
- IApplicationDiscriminator.Discriminator
- DataProtectionOptions.ApplicationDiscriminator
- AuthenticatedEncryptorFactory.CreateEncryptorInstance(IKey)
- CngCbcAuthenticatedEncryptorFactory.CreateEncryptorInstance(IKey)
- CngGcmAuthenticatedEncryptorFactory.CreateEncryptorInstance(IKey)
- IAuthenticatedEncryptorFactory.CreateEncryptorInstance(IKey)
- ManagedAuthenticatedEncryptorFactory.CreateEncryptorInstance(IKey)
- IKey.CreateEncryptor()
- KeyManagementOptions.AuthenticatedEncryptorConfiguration
- KeyManagementOptions.XmlEncryptor
- KeyManagementOptions.XmlRepository
- ICertificateResolver.ResolveCertificate(String)
- DataProtectionUtilityExtensions.GetApplicationUniqueIdentifier(IServiceProvider)
- FileSystemXmlRepository.DefaultKeyStorageDirectory
- RegistryXmlRepository.DefaultRegistryKey
- CertificateResolver.ResolveCertificate(String)
- IConnectionListener.AcceptAsync(CancellationToken)
- AuthenticationSchemeOptions.ForwardDefaultSelector
- RangeConditionHeaderValue.RangeConditionHeaderValue(EntityTagHeaderValue)
- IHttpContextFeature.HttpContext
- CompletionMessage.WithError
- CompletionMessage.WithResult
- HubMethodInvocationMessage.Arguments
- HubMethodInvocationMessage.HubMethodInvocationMessage(String, String, Object[])
- HubMethodInvocationMessage.HubMethodInvocationMessage(String, String, Object[], String[])
- InvocationMessage.InvocationMessage(String, Object[])
- InvocationMessage.InvocationMessage(String, String, Object[])
- InvocationMessage.InvocationMessage(String, String, Object[], String[])
- StreamInvocationMessage.StreamInvocationMessage(String, String, Object[])
- StreamInvocationMessage.StreamInvocationMessage(String, String, Object[], String[])
- IHubProtocol.TryParseMessage(ReadOnlySequence<Byte>, IInvocationBinder, HubMessage)
- DefaultHubLifetimeManager<THub>.SendAllAsync(String, Object[], CancellationToken)
- DefaultHubLifetimeManager<THub>.SendAllExceptAsync(String, Object[], IReadOnlyList<String>, CancellationToken)
- DefaultHubLifetimeManager<THub>.SendConnectionAsync(String, String, Object[], CancellationToken)
- DefaultHubLifetimeManager<THub>.SendConnectionsAsync(IReadOnlyList<String>, String, Object[], CancellationToken)
- DefaultHubLifetimeManager<THub>.SendGroupAsync(String, String, Object[], CancellationToken)
- DefaultHubLifetimeManager<THub>.SendGroupExceptAsync(String, String, Object[], IReadOnlyList<String>, CancellationToken)
- DefaultHubLifetimeManager<THub>.SendGroupsAsync(IReadOnlyList<String>, String, Object[], CancellationToken)
- DefaultHubLifetimeManager<THub>.SendUserAsync(String, String, Object[], CancellationToken)
- DefaultHubLifetimeManager<THub>.SendUsersAsync(IReadOnlyList<String>, String, Object[], CancellationToken)
- DefaultHubLifetimeManager<THub>.SendAllAsync(String, Object[], CancellationToken)
- DefaultHubLifetimeManager<THub>.SendAllExceptAsync(String, Object[], IReadOnlyList<String>, CancellationToken)
- DefaultHubLifetimeManager<THub>.SendConnectionAsync(String, String, Object[], CancellationToken)
- DefaultHubLifetimeManager<THub>.SendConnectionsAsync(IReadOnlyList<String>, String, Object[], CancellationToken)
- DefaultHubLifetimeManager<THub>.SendGroupAsync(String, String, Object[], CancellationToken)
- DefaultHubLifetimeManager<THub>.SendGroupExceptAsync(String, String, Object[], IReadOnlyList<String>, CancellationToken)
- DefaultHubLifetimeManager<THub>.SendGroupsAsync(IReadOnlyList<String>, String, Object[], CancellationToken)
- DefaultHubLifetimeManager<THub>.SendUserAsync(String, String, Object[], CancellationToken)
- DefaultHubLifetimeManager<THub>.SendUsersAsync(IReadOnlyList<String>, String, Object[], CancellationToken)
- IClientProxy.SendCoreAsync
- HubConnectionContext.User
- QueryHelpers.ParseNullableQuery(String)
- QueryHelpers.ParseQuery(String)