-
Notifications
You must be signed in to change notification settings - Fork 5.4k
Description
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.
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.
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 is true before using calling NullabilityInfoContext.Create.
Reproduction Steps
Run a BlazorWebAssembly application like this one:
Expected behavior
Application should not throw an exception when the System.Reflection.NullabilityInfoContext.IsSupported flag is false.
Actual behavior
An exception is thrown.
Regression?
Yes
Known Workarounds
Enable the System.Reflection.NullabilityInfoContext.IsSupported switch.
Configuration
No response
Other information
No response