C'est fini! PVS-Studio prend en charge l'analyse de projets pour .NET 5

Le 10 novembre 2020, une nouvelle version de .NET Core a été publiée, officiellement nommée .NET 5. La plate-forme mise à jour offre de nombreuses fonctionnalités différentes. Par exemple, il permet aux développeurs C # d'utiliser les innovations de C # 9: enregistrements, correspondance de modèles relationnels, etc. Malheureusement, il y a aussi des inconvénients - il est impossible d'analyser correctement un tel projet en utilisant PVS-Studio. Eh bien ... Ce n'était pas possible avant. Après tout, ce problème appartient désormais au passé - la prochaine version de PVS-Studio 7.13 prendra en charge l'analyse des projets axés sur .NET 5!





Aka .NET Core 4

.NET 5 , , .NET Core 3.1. ".NET", Microsoft , . – 3 preview- .NET 6. , 3.1, 5? , , , Windows 8.1 Windows 10 :)





, 4 , .NET Framework .NET. , "Entity Framework Core 5.0", .NET 5, "Core". , Core Framework "Entity Framework 5.0".





.NET 5 . , C# . , , . , , . C# 9 .





.NET 5 .





PVS-Studio .NET 5

.NET 5 . , . – , PVS-Studio. :( , -, , .NET 5.





Windows, Linux macOS. Windows , , .NET Framework 4.7.2. Linux macOS .NET 5 ( .NET Core 3.1).





Linux macOS .NET 5?

Linux/macOS .NET Core 3.1 .NET 5. , , , . , , .





, .NET Core (, , .NET 5), PVS-Studio SDK . - , .NET 5 SDK "System.Runtime" 5. , .NET Core 3.1, "System.Runtime" 3.1. – SDK .





.NET Core .NET 5 :).





.NET 5 . , PVS-Studio Roslyn MSBuild. , C# 9. ,





user = user with { Name = "Bill" }

      
      



, WithExpression. , user . , , . :(. , . .





. , , . – . , . , .





top-level statements. C#- , , , . . . C#- ... , , . , :)





, , – init-. V3140.





, . RunUO:





private bool m_IsRewardItem;

[CommandProperty( AccessLevel.GameMaster )]
public bool IsRewardItem
{
  get{ return m_IsRewardItem; }
  set{ m_IsRewardItem = value; InvalidateProperties(); }
}

private bool m_East;

[CommandProperty( AccessLevel.GameMaster )]
public bool East                                       // <=
{
  get{ return m_East; }
  set{ m_IsRewardItem = value; InvalidateProperties(); } 
}

      
      



PVS-Studio: V3140 Property accessors use different backing fields. WallBanner.cs 77





V3140 , 2 – get set. init . – ! , .





?

! , , , -... , ? , – ! . , , ( ) .NET 5 !





PVS-Studio. , . PVS-Studio .





, : Nikita Lipilin. Finally! PVS-Studio Supports .NET 5 Projects.








All Articles