Build errors with visual studio 2019

I'm able to build a MS C# solution with devenv and msbuild perfectly; the commands I use are as follows:

msbuild /t:build /p:Configuration=Debug /p:Platform="Any CPU" /p:VisualStudioDir="C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise" D:\foo.sln

devenv D:\foo.sln /Rebuild

However when I try and build it with sourceanalyzer, I run into a few different problems, as follows:

"C:\Program Files\Fortify\Fortify_SCA_and_Apps_19.1.0\bin\sourceanalyzer.exe" -b bar devenv D:\foo.sln /Rebuild

I get the following error:

Building the projects in this solution one at a time. To enable parallel build, please add the "-m" switch.
D:\foor.sln.metaproj : error MSB4126: The specified solution configuration "Debug|x64" is invalid. Please specify a valid solution configuration using the Configuration and Platform properties (e.g. MSBuild.exe Solution.sln /p:Configuration=Debug /p:Platform="Any CPU") or leave those properties blank to use the default solution configuration. [D:foo.sln]
Build started 00/00/0000 0:00:00 AM.

Build FAILED.

 

If I try and run

"C:\Program Files\Fortify\Fortify_SCA_and_Apps_19.1.0\bin\sourceanalyzer.exe" -b bar touchless msbuild /t:build /p:Configuration=Debug /p:Platform="Any CPU" /p:VisualStudioDir="C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise" foo.sln

I get the following error:

"D:\foor.sln" (build target) (1) ->
"D:\src\baz.Test.csproj" (default target) (16) ->
C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Current\Bin\Microsoft.Common.CurrentVersion.targets(2106,5): warning MSB3277: Found conflicts between different versions of "Microsoft.Extensions.Logging" that could not be resolved. These reference conflicts are listed in the build log when log verbosity is set to detailed. [D:\src\baz.csproj]

...

26 Warning(s)
0 Error(s)

Time Elapsed 00:00:03.34
Build started 00/00/0000 00:00:00 AM.

Build FAILED.

Can anyone help with this please?

Tags: