Main Content

Install Polyspace as You Code Extension in Visual Studio

The Polyspace® as You Code extension in the Visual Studio® IDE allows you to run Polyspace on the file that you are currently viewing and checks your code for bugs and coding standard violations. You must install the Polyspace as You Code analysis engine to run the analysis. The extension allows you to point to this analysis engine from Visual Studio and show results produced by the Polyspace analysis.

You can install the extension in one of two ways:

  • While running the Polyspace as You Code installer, select the option to install the extension. The installer installs the Polyspace as You Code analysis engine and the extension.

    See Install Polyspace as You Code Using Installer.

  • If you install only the analysis engine while running the Polyspace as You Code installer, use the Visual Studio extension installer (VSIX) file at a later time. The VSIX file is available only after you run the installer.

    You can install the extension in Visual Studio 2019 version 16.11.* and later and in Visual Studio 2022 version 17.2.* and later.

Note

Before you install the Polyspace as You Code extension in Visual Studio, uninstall any previous version of the extension.

The rest of this topic describes the second approach where you skip the installation of the extension while running the installer and use the VSIX file to install the extension later.

Interactive Installation

To install the extension interactively:

  1. Double-click the .vsix file in the folder polyspaceroot\polyspace\plugin\visual_studio.

    Here, polyspaceroot is the Polyspace as You Code installation folder, for example, C:\Program Files\Polyspace as You Code\R2024b.

  2. Follow the prompts on the screen.

    If you see a message that indicates that your Visual Studio installation does not satisfy the prerequisites for the extension and you are using Visual Studio 2019, install the latest updates and try re-installing the extension.

After installation, open Visual Studio and verify that the extension has been installed. For example, in Visual Studio 2019, select Extensions > Manage Extensions. You should see Polyspace in the list of extensions installed. You can also disable or uninstall the extension from this list.

Command-Line Installation

To install the extension without opening a graphical user interface, run the VSIX installer at the command line with the /q flag.

  • To install the extension in all Visual Studio versions on the machine, enter:

    cd VSIXInstallerpath
    VSIXInstaller.exe /q polyspaceroot\polyspace\plugin\visual_studio\polyspace_as_you_code.vsix
    Here, VSIXInstallerpath is the path to the VSIX installer file. For example, in a Visual Studio 2019 installation, the path can be C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\Common7\IDE.

  • To install the extension on a specific Visual Studio version, enter:

    cd VSIXInstallerpath
    VSIXInstaller.exe /q /s:name /v:version ^ 
    polyspaceroot\polyspace\plugin\visual_studio\polyspace_as_you_code.vsix
    Here, name is the name of the Visual Studio application, for example, Pro for the Visual Studio Professional edition. version is the version number in the form major.minor, for example, 16.11 for the major version of Visual Studio 2019.

To uninstall the extension silently, use the /u flag. Use of the /u flag requires a vsixID value. To find the vsixID value of your VSIX file:

  1. Make a copy of the VSIX file and rename it as a ZIP file with a .zip filename extension.

  2. Open the ZIP file and locate the extension.vsixmanifest XML file.

  3. Open the extension.vsixmanifest XML file. Your vsixID value is the number "guid" in the <Identity Id="guid" /> tag.

An example of the /u flag containing a vsixID is:

VSIXInstaller.exe /u:Polyspace.1234a5bc-d678-9e01-f234-5gh6789ijklm

For more information on the flags, enter:

cd VSIXInstallerpath
VSIXInstaller.exe

Related Topics