You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This was introduced in #102499. This blocking runtime ingestion in ASP.NET for preview 5.
This exception is thrown when running a BlazorWasm application.
NullabilityInfoContext is not supported in the current application because 'System.Reflection.NullabilityInfoContext.IsSupported' is set to false. Set the MSBuild Property 'NullabilityInfoContextSupport' to true in order to enable it.
System.Reflection.NullabilityInfoContext.IsSupported is used by apps to trim nullability annotations, as @eiriktsarpalis mentioned offline, we could bail when the switch is set to false and process things like they were nullable-oblivious, but it feels odd that NullabilityInfoContext throws here rather than returning new NullabilityInfo { ReadState = NullabilityState.Unknown, WriteState = NullabilityState.Unknown }.
Description
This was introduced in #102499. This blocking runtime ingestion in ASP.NET for preview 5.
This exception is thrown when running a BlazorWasm application.
The BlazorWebAssembly SDK disabled the feature https://github.com/dotnet/sdk/blob/a304e06708d72c1be0d78e214366a2c7c601b5d8/src/BlazorWasmSdk/Targets/Microsoft.NET.Sdk.BlazorWebAssembly.6_0.targets#L49
This method should check
NullabilityInfoContext.IsSupported
istrue
before using callingNullabilityInfoContext.Create
.Reproduction Steps
Run a BlazorWebAssembly application like this one:
https://github.com/dotnet/aspnetcore/blob/release/9.0-preview5/src/Components/WebAssembly/testassets/StandaloneApp/StandaloneApp.csproj
Expected behavior
Application should not throw an exception when the
System.Reflection.NullabilityInfoContext.IsSupported
flag isfalse
.Actual behavior
An exception is thrown.
Regression?
Yes
Known Workarounds
Enable the
System.Reflection.NullabilityInfoContext.IsSupported
switch.Configuration
No response
Other information
No response
The text was updated successfully, but these errors were encountered: