Apparently, from .NET 5 onwards, the assembly name is changed from System.Runtime.Extensions.dll to System.Runtime.dll, so all the annotations aren't activated anymore.
For example, Math.Max(1, 3) and Convert.ToBoolean(42) are not marked [Pure] when csproj is targeted to net5.0 instead of netcoreapp3.1 (tested in Rider 2021.1.5 and ReSharper 2021.1.5).
You can see the Assembly changed in the docs, for example:
Apparently, from .NET 5 onwards, the assembly name is changed from
System.Runtime.Extensions.dll
toSystem.Runtime.dll
, so all the annotations aren't activated anymore.For example,
Math.Max(1, 3)
andConvert.ToBoolean(42)
are not marked[Pure]
when csproj is targeted tonet5.0
instead ofnetcoreapp3.1
(tested in Rider 2021.1.5 and ReSharper 2021.1.5).This commit simply copies
*.xml
fromSystem.Runtime.Extensions
toSystem.Runtime
and changes<assembly name="">
accordingly.