core

.NET 8.0 Known Issues

You may encounter the following known issues, which may include workarounds, mitigations, or expected resolution timeframes.

.NET SDK

[8.0.100-preview.1.23115.2] analyzer CA2009 throws InvalidCastException at runtime could cause a build failure

CA2009: Do not call ToImmutableCollection on an ImmutableCollection value analyzer regressed in .NET 8 preview 1, the regression could cause a build failure if:

public ImmutableArray<int>  Method(int [] arr)
{
    return arr.ToImmutableArray();
}

Then the build would fail with an error:

error AD0001: Analyzer 'Microsoft.NetCore.Analyzers.ImmutableCollections.DoNotCallToImmutableCollectionOnAnImmutableCollectionValueAnalyzer' threw an exception of type 'System.InvalidCastException' with message 'Unable to cast object of type 'Microsoft.CodeAnalysis.CSharp.Symbols.PublicModel.ArrayTypeSymbol' to type 'Microsoft.CodeAnalysis.INamedTypeSymbol'.

Resolution

.NET MAUI

For details about known issues, please refer to the individual repositories:

Native AOT Support in .NET

For details about known issues, please reference to the pinned issue in this repo.