Změněné poznámky typu odkazu s možnou hodnotou Null
Počínaje ASP.NET Core 5.0 se u částí kódu použily poznámky nullability. Od počátku tohoto úsilí by se v těchto poznámkách očekávaly chyby a opravy. V ASP.NET Core 6.0 se aktualizují některé dříve použité poznámky. Některé z těchtozměnch Změny vedou k nekompatibilním nebo více omezujícím rozhraním API. Aktualizovaná rozhraní API můžou mít za následek upozornění v době sestavení při použití v projektech s povolenými odkazovými typy s možnou hodnotou null.
Diskuzi najdete v tématu o problému GitHubu dotnet/aspnetcore#27564.
Zavedená verze
ASP.NET Core 6.0
Staré chování
Ovlivněná rozhraní API mají nesprávné poznámky typu odkazu s možnou hodnotou null. Upozornění sestavení buď chybí, nebo jsou nesprávná.
Nové chování
Vytvoří se nová upozornění sestavení. Pro ovlivněná rozhraní API se už nevygenerují nesprávná upozornění sestavení.
Důvod změny
Prostřednictvím zpětné vazby a dalšího testování se zjistily nepřesné poznámky s možnou hodnotou null pro ovlivněná rozhraní API. Aktualizované poznámky teď správně představují kontrakty s nulovostí pro rozhraní API.
Doporučená akce
Aktualizujte kód volající tato rozhraní API tak, aby odrážel revidované kontrakty s nulovostí.
Ovlivněná rozhraní API
- 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)
Viz také
Váš názor
https://aka.ms/ContentUserFeedback.
Připravujeme: V průběhu roku 2024 budeme postupně vyřazovat problémy z GitHub coby mechanismus zpětné vazby pro obsah a nahrazovat ho novým systémem zpětné vazby. Další informace naleznete v tématu:Odeslat a zobrazit názory pro