site/xunit.analyzers/rules/xUnit9005.md
A violation of this rule occurs when a collection definition class is declared as generic.
Collection definition classes are most often declared as generic in order to support open generic fixture types. However, open generics require runtime reflection features that are not available in Native AOT.
To fix a violation of this rule, remove the generic declaration on the collection definition (and use non-generic or closed-generic fixture types instead).
using Xunit;
[CollectionDefinition]
public class xUnit9005<T> : ICollectionFixture<MyFixture<T>>
{ }
using Xunit;
[CollectionDefinition]
public class xUnit9005 : ICollectionFixture<MyFixture<int>>
{ }