Cadet 3rd Class
Cadet 3rd Class
382 views

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?

Labels (1)
0 Likes
1 Reply
Vice Admiral Vice Admiral
Vice Admiral

I have not seen this, did you enable -verbose logging and look in the build log file as noted by the exception message?

These reference conflicts are listed in the build log when log verbosity is set to detailed. [D:\src\baz.csproj]

 

 

0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.