Nous utilisons des cookies pour améliorer votre expérience de navigation. En savoir plus
Accepter
to the top
close form

Remplissez le formulaire ci‑dessous en 2 étapes simples :

Vos coordonnées :

Étape 1
Félicitations ! Voici votre code promo !

Type de licence souhaité :

Étape 2
Team license
Enterprise licence
** En cliquant sur ce bouton, vous déclarez accepter notre politique de confidentialité
close form
Demandez des tarifs
Nouvelle licence
Renouvellement de licence
--Sélectionnez la devise--
USD
EUR
* En cliquant sur ce bouton, vous déclarez accepter notre politique de confidentialité

close form
La licence PVS‑Studio gratuit pour les spécialistes Microsoft MVP
close form
Pour obtenir la licence de votre projet open source, s’il vous plait rempliez ce formulaire
* En cliquant sur ce bouton, vous déclarez accepter notre politique de confidentialité

close form
I am interested to try it on the platforms:
* En cliquant sur ce bouton, vous déclarez accepter notre politique de confidentialité

close form
check circle
Votre message a été envoyé.

Nous vous répondrons à


Si vous n'avez toujours pas reçu de réponse, vérifiez votre dossier
Spam/Junk et cliquez sur le bouton "Not Spam".
De cette façon, vous ne manquerez la réponse de notre équipe.

>
>
PVS-Studio C# installation on Linux and…
menu mobile close menu
Analyzer diagnostics
General Analysis (C++)
General Analysis (C#)
General Analysis (Java)
Micro-Optimizations (C++)
Diagnosis of 64-bit errors (Viva64, C++)
Customer specific requests (C++)
MISRA errors
AUTOSAR errors
OWASP errors (C#)
Problems related to code analyzer
Additional information
toggle menu Contents

PVS-Studio C# installation on Linux and macOS

26 Nov 2021

Note. To install the analyzer on Windows operating systems, you can use the installer available on the analyzer download page. Windows installer supports installation in both graphical and unattended (command-line installation) modes.

PVS-Studio C# dependencies

The PVS-Studio C# analyzer requires a number of additional packages. Depending on how PVS-Studio C# is installed these dependency packages will be installed automatically by the package manager, or they will need to be installed manually.

.NET SDK

The analyzer requires .NET SDK 8.0 installed on a machine. Instructions for adding the .NET repository to various Linux distributions can be found here.

The .NET SDK for macOS can be downloaded from this page.

Note. When installing pvs-studio-dotnet via the package manager on Linux, the version of the .NET SDK required for the analyzer will be installed automatically, but the .NET repository must first be added manually.

pvs-studio

The PVS-Studio C# analyzer requires the presence of the PVS-Studio C++ analyzer (pvs-studio) to work.

Note. When installing the PVS-Studio C# analyzer package (pvs-studio-dotnet) via the package manager, the C++ analyzer package (pvs-studio) will be installed automatically and you can skip this step.

When installing the C# analyzer via unpacking the archive, you must also install the C++ analyzer (pvs-studio). The C++ analyzer must be installed in the following directories:

  • Linux: any directory whose path is written in the 'PATH' environment variable;
  • macOS: /usr/local/bin/pvs-studio

Instructions for installing pvs-studio are available in the corresponding sections of the documentation: Linux, macOS.

Installing the analyzer on Linux operating systems

Installation from repositories

Installing from the repository is the recommended method that allows you to automatically install the necessary dependencies and get updates.

For debian-based systems

wget -q -O - https://cdn.pvs-studio.com/etc/pubkey.txt | \
  sudo apt-key add -
sudo wget -O /etc/apt/sources.list.d/viva64.list \
  https://cdn.pvs-studio.com/etc/viva64.list
sudo apt-get update
sudo apt-get install pvs-studio-dotnet

For yum-based systems

wget -O /etc/yum.repos.d/viva64.repo \
  https://cdn.pvs-studio.com/etc/viva64.repo
yum update
yum install pvs-studio-dotnet

For zypper-based systems

wget -q -O /tmp/viva64.key https://cdn.pvs-studio.com/etc/pubkey.txt
sudo rpm --import /tmp/viva64.key
sudo zypper ar -f https://cdn.pvs-studio.com/rpm viva64
sudo zypper update
sudo zypper install pvs-studio-dotnet

Manual installation

Direct links to download packages / archives are available on the download page. The installation / unpacking commands are given below.

Deb package

sudo gdebi pvs-studio-dotnet-VERSION.deb

or

sudo apt-get -f install pvs-studio-dotnet-VERSION.deb

Rpm package

sudo dnf install pvs-studio-dotnet-VERSION.rpm

or

sudo zypper install pvs-studio-dotnet-VERSION.rpm

or

sudo yum install pvs-studio-dotnet-VERSION.rpm

or

sudo rpm -i pvs-studio-dotnet-VERSION.rpm

Archive

tar -xzf pvs-studio-dotnet-VERSION.tar.gz
sudo ./install.sh

Analyzer installation on macOS

Installation from Homebrew

Installation commands:

brew install viva64/pvs-studio/pvs-studio
brew install viva64/pvs-studio/pvs-studio-dotnet

Update commands:

brew upgrade pvs-studio
brew upgrade pvs-studio-dotnet

Manual installation

The command to unpack the archive:

tar -xzf pvs-studio-dotnet-VERSION.tar.gz
sudo sh install.sh

License entering

Before using the PVS-Studio analyzer, make sure that the license is entered. You can find more information about entering the license here.

Projects analysis

Analyzer usage is described in the corresponding section of the documentation.