JetBrains / ExternalAnnotations

JetBrains ReSharper External Annotations
https://www.jetbrains.com/help/resharper/Code_Analysis__External_Annotations.html
MIT License
81 stars 44 forks source link

Copy System.Runtime.Extensions/*.xml to System.Runtime #219

Closed GitHubPang closed 3 years ago

GitHubPang commented 3 years ago

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: .NET 5 .NET Core 3.1
https://docs.microsoft.com/en-us/dotnet/api/system.math?view=net-5.0 https://docs.microsoft.com/en-us/dotnet/api/system.math?view=netcore-3.1
https://docs.microsoft.com/en-us/dotnet/api/system.convert?view=net-5.0 https://docs.microsoft.com/en-us/dotnet/api/system.convert?view=netcore-3.1
https://docs.microsoft.com/en-us/dotnet/api/system.net.webutility?view=net-5.0 https://docs.microsoft.com/en-us/dotnet/api/system.net.webutility?view=netcore-3.1

This commit simply copies *.xml from System.Runtime.Extensions to System.Runtime and changes <assembly name=""> accordingly.

sirduke commented 3 years ago

@GitHubPang, thank you very much!