visual-studiopvs-studio

How to run .NET Core project with PVS-Studio without Visual Studio?


I have the free license for PVS-Studio and I installed the program to Windows 10 computer without issues. I gave the registration info via Standalone.exe and registration went OK. This computer doesn't not have Visual Studio installed (only Dotnet core SDK and Visual Studio Code)

When I try to run dotnet core project with it

PVS-Studio_Cmd.exe -t C:\Users\someuser\projects\myproject.csproj

I get following error

PVS-Studio Command Line Analyzer 7.0.29703.1460 Copyright (c) 2008-2019 OOO "Program Verification Systems" Using default settings file: C:\Users\someuser\AppData\Roaming\PVS-Studio\Settings.xml Exception message: The imported project "C:\Windows\Microsoft.NET\Framework64\15.0\Microsoft.Common.props" was not found. Also, tried to find "\15.0\Microsoft.Common.props" in the fallback search path(s) for $(MSBuildExtensionsPath) - "C:\Program Files (x86)\MSBuild" . These search paths are defined in "c:\Program Files (x86)\PVS-Studio\PVS-Studio_Cmd.exe.Config". Confirm that the path in the declaration is correct, and that the file exists on disk in one of the search paths. C:\Program Files\dotnet\sdk\2.1.301\Sdks\Microsoft.NET.Sdk\Sdk\Sdk.props

So how should I fix the problem?

The project can be correctly build with dotnet build command.


Solution

  • This issue will be resolved in the upcoming PVS-Studio version 7.02 release, which will also add support for Visual Studio 2019. .NET Core projects can now be analyzed without the need to install Visual Studio.