Visual Studio Project command-line syntax

The basic syntax to translate a Visual Studio solution or project is to specify the corresponding build option for your project as part of the OpenText SAST translation command. This starts a build integration that analyzes your solution and project files and automatically executes the appropriate translation steps.

Important! To ensure that the build integration correctly pulls in all of the appropriate project dependencies and resources, you must run the OpenText SAST command from a command prompt with access to your build environment configuration. OpenText strongly recommends you run this command from the Developer Command Prompt for Visual Studio to ensure an optimal environment for the translation.

In the following examples, OpenText SAST translates all the projects contained in the Visual Studio solution Sample.sln. You can also translate one or more specific projects by providing a semicolon-separated list of projects.

By default, test projects are excluded from the translation. Projects in your solution that reference NUnit, xunit, or MSTest are considered a test project. To include test projects in the translation, add the MSBuild option /p:ScaForceTranslateTestProjects=True to your sourceanalyzer command.

After the translation is complete, perform the analysis phase and save the results in an FPR file as shown in the following example:

sourceanalyzer –b MyProject -scan -f MyResults.fpr