Open
Description
Running dotnet publish
fails when the publish directory is specified and has a semi-colon (either in a specified absolute path or computed from a specified relative path)
Related to this, dotnet-publish fails with semicolon as well.
$ dotnet new console -n 't;e;s;t' $ cd 't;e;s;t' $ dotnet publish -o dist MSBUILD : error MSB1006: Property is not valid. Switch: e For switch syntax, type "MSBuild -help" $ dotnet publish -p:PublishDir="$(pwd)/dist" The "HasTrailingSlash" function only accepts a scalar value, but its argument "$(ClickOncePublishDir)" evaluates to "/Users/adeel/projects/t;e;s;t/dist" which is not a scalar value. /Users/adeel/.dotnet9/sdk/9.0.100-rc.1.24414.26/Microsoft.Common.CurrentVersion.targets MSBUILD : error MSB1006: Property is not valid. Switch: e For switch syntax, type "MSBuild -help" # without publishdir or -o / --output, it works $ dotnet publish Restore complete (0,3s) You are using a preview version of .NET. See: https://aka.ms/dotnet-support-policy t;e;s;t succeeded (0,3s) → bin/Release/net9.0/publish/ Build succeeded in 0,7s