It is finished! PVS-Studio supports the analysis of projects for .NET 5

On November 10, 2020, a new version of .NET Core was released, officially named .NET 5. The updated platform provides many different capabilities. For example, it allows C # developers to use the innovations of C # 9: records, relational pattern matching, etc. Unfortunately, there are also disadvantages - it is impossible to correctly analyze such a project using PVS-Studio. Well ... It wasn't possible before. After all, now this problem is in the past - the next release of PVS-Studio 7.13 will support the analysis of projects focused on .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