core icon indicating copy to clipboard operation
core copied to clipboard

dotnet build error MSB4115 - NET SDK 6.0.4 and further

Open mcsdodo opened this issue 3 years ago • 1 comments

Building with command dotnet build PATH_TO_MY_PROJECT -target:Package -property:Configuration=Debug;SolutionDir=..\;PackageLocation=pkg;AllowUnsafeBlocks=true -r win10-x64

and from SDK version 6.0.4 and no we got an error. Was working fine until now.

c:\program files\dotnet\sdk\6.0.400\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.DefaultOutputPaths.targets(35,17): error MSB4115: The "HasTrailingSlash" function only accepts a scalar value, but its argument "$(OutputPath)" evaluates to "bin\Debug;SolutionDir=..\;Pack
ageLocation=pkg;AllowUnsafeBlocks=true\" which is not a scalar value.

and it also creates undeletable (by windows means) folders in /bin (with names like Debug;SolutionDir=..)

Documentation states that -property key/value pairs should be separated by semicolon or comma. With commas the command in question works.

mcsdodo avatar Sep 13 '22 05:09 mcsdodo