dotnet / msbuild

The Microsoft Build Engine (MSBuild) is the build platform for .NET and Visual Studio.
https://docs.microsoft.com/visualstudio/msbuild/msbuild
MIT License
5.19k stars 1.35k forks source link

`-p:BaseOutputPath=` doesn't override property on linux #10273

Open cschuchardt88 opened 1 month ago

cschuchardt88 commented 1 month ago

Description

The below publish command doesn't work on linux when BaseOutputPath property is set in the project.###

Reproduction Steps

*.csproj file

<BaseOutputPath>$(SolutionDir)/bin/$(AssemblyTitle)</BaseOutputPath>

Pushlish (works on windows)

Publish from project file will have $(SolutionDir) empty and render the link to /bin/Neo.CLI for example. That is normal. However then I tack on to the dotnet publish command -p:BaseOutputPath=/home/runner/work/neo/neo/bin/Neo.CLI/build it should override that property. It doesn't do that, but does on windows no problem; NOT LINUX.

dotnet publish ./src/Neo.CLI \
  --version-suffix 3.7.5
  --framework net8.0 \
  --configuration Release \
  --runtime linux-x64 \
  --self-contained true \
  --output /tmp/out/linux-x64 \
  --verbosity normal \
  -p:BaseOutputPath=/home/runner/work/neo/neo/bin/Neo.CLI/build \
  -p:RuntimeIdentifier=linux-x64 \
  -p:SelfContained=true \
  -p:IncludeNativeLibrariesForSelfExtract=false \
  -p:PublishTrimmed=false \
  -p:PublishSingleFile=true \
  -p:PublishReadyToRun=true \
  -p:EnableCompressionInSingleFile=true \
  -p:DebugType=embedded \
  -p:ServerGarbageCollection=true

Expected behavior

Work like it does on windows.

Actual behavior

2024-06-08T05:47:22.7816292Z ##[group]Run dotnet publish ./src/Neo.CLI \
2024-06-08T05:47:22.7816850Z dotnet publish ./src/Neo.CLI \
2024-06-08T05:47:22.7817304Z --version-suffix 3.7.5
2024-06-08T05:47:22.7817821Z --framework net8.0 \
2024-06-08T05:47:22.7818198Z --configuration Release \
2024-06-08T05:47:22.7818630Z --runtime linux-x64 \
2024-06-08T05:47:22.7819094Z --self-contained true \
2024-06-08T05:47:22.7819476Z --output /tmp/out/linux-x64 \
2024-06-08T05:47:22.7819931Z --verbosity normal \
2024-06-08T05:47:22.7820545Z -p:BaseOutputPath=/home/runner/work/neo/neo/bin/Neo.CLI/build \
2024-06-08T05:47:22.7821136Z -p:RuntimeIdentifier=linux-x64 \
2024-06-08T05:47:22.7821556Z -p:SelfContained=true \
2024-06-08T05:47:22.7822342Z -p:IncludeNativeLibrariesForSelfExtract=false \
2024-06-08T05:47:22.7822887Z -p:PublishTrimmed=false \
2024-06-08T05:47:22.7823280Z -p:PublishSingleFile=true \
2024-06-08T05:47:22.7823899Z -p:PublishReadyToRun=true \
2024-06-08T05:47:22.7824334Z -p:EnableCompressionInSingleFile=true \
2024-06-08T05:47:22.7824861Z -p:DebugType=embedded \
2024-06-08T05:47:22.7825302Z -p:ServerGarbageCollection=true
2024-06-08T05:47:22.7885199Z shell: /usr/bin/bash -e {0}
2024-06-08T05:47:22.7885591Z env:
2024-06-08T05:47:22.7885861Z   DOTNET_VERSION: 8.0.x
2024-06-08T05:47:22.7886330Z   CONFIGURATION: Release
2024-06-08T05:47:22.7886707Z   DIST_PATH: /tmp/dist
2024-06-08T05:47:22.7887026Z   OUTPUT_PATH: /tmp/out
2024-06-08T05:47:22.7887479Z   APP_VERSION: 3.7.5
2024-06-08T05:47:22.7887843Z   DOTNET_ROOT: /usr/share/dotnet
2024-06-08T05:47:22.7888198Z ##[endgroup]
2024-06-08T05:47:24.5616253Z   Determining projects to restore...
2024-06-08T05:47:28.1198962Z   Restored /home/runner/work/neo/neo/src/Neo.Extensions/Neo.Extensions.csproj (in 1.59 sec).
2024-06-08T05:47:28.1201002Z   Restored /home/runner/work/neo/neo/src/Neo.Cryptography.BLS12_381/Neo.Cryptography.BLS12_381.csproj (in 1.58 sec).
2024-06-08T05:47:28.1203183Z   Restored /home/runner/work/neo/neo/src/Neo.ConsoleService/Neo.ConsoleService.csproj (in 1.59 sec).
2024-06-08T05:47:28.1255411Z   Restored /home/runner/work/neo/neo/src/Neo.VM/Neo.VM.csproj (in 2 ms).
2024-06-08T05:47:28.1445016Z   Restored /home/runner/work/neo/neo/src/Neo.IO/Neo.IO.csproj (in 13 ms).
2024-06-08T05:47:28.4616981Z   Restored /home/runner/work/neo/neo/src/Neo.Json/Neo.Json.csproj (in 336 ms).
2024-06-08T05:47:28.5741786Z   Restored /home/runner/work/neo/neo/src/Neo/Neo.csproj (in 447 ms).
2024-06-08T05:47:28.5765696Z   Restored /home/runner/work/neo/neo/src/Neo.CLI/Neo.CLI.csproj (in 2.05 sec).
2024-06-08T05:47:28.6725771Z /usr/share/dotnet/sdk/8.0.301/Microsoft.Common.CurrentVersion.targets(1197,5): warning MSB3191: Unable to create directory "/bin/Neo.CLI/Release/net8.0/". Access to the path '/bin/Neo.CLI' is denied. [/home/runner/work/neo/neo/src/Neo.CLI/Neo.CLI.csproj]
2024-06-08T05:47:29.1816288Z /usr/share/dotnet/sdk/8.0.301/Microsoft.Common.CurrentVersion.targets(1197,5): warning MSB3191: Unable to create directory "/bin/Neo.Extensions/Release/net8.0/". Access to the path '/bin/Neo.Extensions' is denied. [/home/runner/work/neo/neo/src/Neo.Extensions/Neo.Extensions.csproj::TargetFramework=net8.0]
2024-06-08T05:47:29.1842545Z /usr/share/dotnet/sdk/8.0.301/Microsoft.Common.CurrentVersion.targets(1197,5): warning MSB3191: Unable to create directory "/bin/Neo.ConsoleService/Release/net8.0/". Access to the path '/bin/Neo.ConsoleService' is denied. [/home/runner/work/neo/neo/src/Neo.ConsoleService/Neo.ConsoleService.csproj::TargetFramework=net8.0]
2024-06-08T05:47:29.1872510Z /usr/share/dotnet/sdk/8.0.301/Microsoft.Common.CurrentVersion.targets(1197,5): warning MSB3191: Unable to create directory "/bin/Neo/Release/net8.0/". Access to the path '/bin/Neo' is denied. [/home/runner/work/neo/neo/src/Neo/Neo.csproj::TargetFramework=net8.0]
2024-06-08T05:47:29.1903140Z /usr/share/dotnet/sdk/8.0.301/Microsoft.Common.CurrentVersion.targets(1197,5): warning MSB3191: Unable to create directory "/bin/Neo.Cryptography.BLS12_381/Release/net8.0/". Access to the path '/bin/Neo.Cryptography.BLS12_381' is denied. [/home/runner/work/neo/neo/src/Neo.Cryptography.BLS12_381/Neo.Cryptography.BLS12_381.csproj::TargetFramework=net8.0]
2024-06-08T05:47:33.8650555Z /usr/share/dotnet/sdk/8.0.301/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.targets(284,5): error MSB4018: The "GenerateDepsFile" task failed unexpectedly. [/home/runner/work/neo/neo/src/Neo.Extensions/Neo.Extensions.csproj::TargetFramework=net8.0]
2024-06-08T05:47:33.8657802Z /usr/share/dotnet/sdk/8.0.301/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.targets(284,5): error MSB4018: System.IO.DirectoryNotFoundException: Could not find a part of the path '/bin/Neo.Extensions/Release/net8.0/Neo.Extensions.deps.json'. [/home/runner/work/neo/neo/src/Neo.Extensions/Neo.Extensions.csproj::TargetFramework=net8.0]
2024-06-08T05:47:33.8687440Z /usr/share/dotnet/sdk/8.0.301/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.targets(284,5): error MSB4018:    at Interop.ThrowExceptionForIoErrno(ErrorInfo errorInfo, String path, Boolean isDirError) [/home/runner/work/neo/neo/src/Neo.Extensions/Neo.Extensions.csproj::TargetFramework=net8.0]
2024-06-08T05:47:33.8694967Z /usr/share/dotnet/sdk/8.0.301/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.targets(284,5): error MSB4018:    at Microsoft.Win32.SafeHandles.SafeFileHandle.Open(String fullPath, FileMode mode, FileAccess access, FileShare share, FileOptions options, Int64 preallocationSize, UnixFileMode openPermissions, Int64& fileLength, UnixFileMode& filePermissions, Boolean failForSymlink, Boolean& wasSymlink, Func`4 createOpenException) [/home/runner/work/neo/neo/src/Neo.Extensions/Neo.Extensions.csproj::TargetFramework=net8.0]
2024-06-08T05:47:33.8703182Z /usr/share/dotnet/sdk/8.0.301/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.targets(284,5): error MSB4018:    at System.IO.Strategies.OSFileStreamStrategy..ctor(String path, FileMode mode, FileAccess access, FileShare share, FileOptions options, Int64 preallocationSize, Nullable`1 unixCreateMode) [/home/runner/work/neo/neo/src/Neo.Extensions/Neo.Extensions.csproj::TargetFramework=net8.0]
2024-06-08T05:47:33.8709316Z /usr/share/dotnet/sdk/8.0.301/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.targets(284,5): error MSB4018:    at System.IO.File.Create(String path) [/home/runner/work/neo/neo/src/Neo.Extensions/Neo.Extensions.csproj::TargetFramework=net8.0]
2024-06-08T05:47:33.8714272Z /usr/share/dotnet/sdk/8.0.301/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.targets(284,5): error MSB4018:    at Microsoft.NET.Build.Tasks.GenerateDepsFile.WriteDepsFile(String depsFilePath) [/home/runner/work/neo/neo/src/Neo.Extensions/Neo.Extensions.csproj::TargetFramework=net8.0]
2024-06-08T05:47:33.8719449Z /usr/share/dotnet/sdk/8.0.301/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.targets(284,5): error MSB4018:    at Microsoft.NET.Build.Tasks.TaskBase.Execute() [/home/runner/work/neo/neo/src/Neo.Extensions/Neo.Extensions.csproj::TargetFramework=net8.0]
2024-06-08T05:47:33.8724986Z /usr/share/dotnet/sdk/8.0.301/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.targets(284,5): error MSB4018:    at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute() [/home/runner/work/neo/neo/src/Neo.Extensions/Neo.Extensions.csproj::TargetFramework=net8.0]
2024-06-08T05:47:33.8731746Z /usr/share/dotnet/sdk/8.0.301/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.targets(284,5): error MSB4018:    at Microsoft.Build.BackEnd.TaskBuilder.ExecuteInstantiatedTask(ITaskExecutionHost taskExecutionHost, TaskLoggingContext taskLoggingContext, TaskHost taskHost, ItemBucket bucket, TaskExecutionMode howToExecuteTask) [/home/runner/work/neo/neo/src/Neo.Extensions/Neo.Extensions.csproj::TargetFramework=net8.0]
2024-06-08T05:47:34.1462517Z /usr/share/dotnet/sdk/8.0.301/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.targets(284,5): error MSB4018: The "GenerateDepsFile" task failed unexpectedly. [/home/runner/work/neo/neo/src/Neo.Cryptography.BLS12_381/Neo.Cryptography.BLS12_381.csproj::TargetFramework=net8.0]
2024-06-08T05:47:34.1468041Z /usr/share/dotnet/sdk/8.0.301/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.targets(284,5): error MSB4018: System.IO.DirectoryNotFoundException: Could not find a part of the path '/bin/Neo.Cryptography.BLS12_381/Release/net8.0/Neo.Cryptography.BLS12_381.deps.json'. [/home/runner/work/neo/neo/src/Neo.Cryptography.BLS12_381/Neo.Cryptography.BLS12_381.csproj::TargetFramework=net8.0]
2024-06-08T05:47:34.1471481Z /usr/share/dotnet/sdk/8.0.301/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.targets(284,5): error MSB4018:    at Interop.ThrowExceptionForIoErrno(ErrorInfo errorInfo, String path, Boolean isDirError) [/home/runner/work/neo/neo/src/Neo.Cryptography.BLS12_381/Neo.Cryptography.BLS12_381.csproj::TargetFramework=net8.0]
2024-06-08T05:47:34.1475802Z /usr/share/dotnet/sdk/8.0.301/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.targets(284,5): error MSB4018:    at Microsoft.Win32.SafeHandles.SafeFileHandle.Open(String fullPath, FileMode mode, FileAccess access, FileShare share, FileOptions options, Int64 preallocationSize, UnixFileMode openPermissions, Int64& fileLength, UnixFileMode& filePermissions, Boolean failForSymlink, Boolean& wasSymlink, Func`4 createOpenException) [/home/runner/work/neo/neo/src/Neo.Cryptography.BLS12_381/Neo.Cryptography.BLS12_381.csproj::TargetFramework=net8.0]
2024-06-08T05:47:34.1480375Z /usr/share/dotnet/sdk/8.0.301/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.targets(284,5): error MSB4018:    at System.IO.Strategies.OSFileStreamStrategy..ctor(String path, FileMode mode, FileAccess access, FileShare share, FileOptions options, Int64 preallocationSize, Nullable`1 unixCreateMode) [/home/runner/work/neo/neo/src/Neo.Cryptography.BLS12_381/Neo.Cryptography.BLS12_381.csproj::TargetFramework=net8.0]
2024-06-08T05:47:34.1483529Z /usr/share/dotnet/sdk/8.0.301/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.targets(284,5): error MSB4018:    at System.IO.File.Create(String path) [/home/runner/work/neo/neo/src/Neo.Cryptography.BLS12_381/Neo.Cryptography.BLS12_381.csproj::TargetFramework=net8.0]
2024-06-08T05:47:34.1486704Z /usr/share/dotnet/sdk/8.0.301/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.targets(284,5): error MSB4018:    at Microsoft.NET.Build.Tasks.GenerateDepsFile.WriteDepsFile(String depsFilePath) [/home/runner/work/neo/neo/src/Neo.Cryptography.BLS12_381/Neo.Cryptography.BLS12_381.csproj::TargetFramework=net8.0]
2024-06-08T05:47:34.1489669Z /usr/share/dotnet/sdk/8.0.301/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.targets(284,5): error MSB4018:    at Microsoft.NET.Build.Tasks.TaskBase.Execute() [/home/runner/work/neo/neo/src/Neo.Cryptography.BLS12_381/Neo.Cryptography.BLS12_381.csproj::TargetFramework=net8.0]
2024-06-08T05:47:34.1492617Z /usr/share/dotnet/sdk/8.0.301/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.targets(284,5): error MSB4018:    at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute() [/home/runner/work/neo/neo/src/Neo.Cryptography.BLS12_381/Neo.Cryptography.BLS12_381.csproj::TargetFramework=net8.0]
2024-06-08T05:47:34.1496438Z /usr/share/dotnet/sdk/8.0.301/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.targets(284,5): error MSB4018:    at Microsoft.Build.BackEnd.TaskBuilder.ExecuteInstantiatedTask(ITaskExecutionHost taskExecutionHost, TaskLoggingContext taskLoggingContext, TaskHost taskHost, ItemBucket bucket, TaskExecutionMode howToExecuteTask) [/home/runner/work/neo/neo/src/Neo.Cryptography.BLS12_381/Neo.Cryptography.BLS12_381.csproj::TargetFramework=net8.0]
2024-06-08T05:47:34.1652323Z /usr/share/dotnet/sdk/8.0.301/Microsoft.Common.CurrentVersion.targets(1197,5): warning MSB3191: Unable to create directory "/bin/Neo.Json/Release/net8.0/". Access to the path '/bin/Neo.Json' is denied. [/home/runner/work/neo/neo/src/Neo.Json/Neo.Json.csproj::TargetFramework=net8.0]
2024-06-08T05:47:34.3007488Z /usr/share/dotnet/sdk/8.0.301/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.targets(284,5): error MSB4018: The "GenerateDepsFile" task failed unexpectedly. [/home/runner/work/neo/neo/src/Neo.ConsoleService/Neo.ConsoleService.csproj::TargetFramework=net8.0]
2024-06-08T05:47:34.3014660Z /usr/share/dotnet/sdk/8.0.301/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.targets(284,5): error MSB4018: System.IO.DirectoryNotFoundException: Could not find a part of the path '/bin/Neo.ConsoleService/Release/net8.0/Neo.ConsoleService.deps.json'. [/home/runner/work/neo/neo/src/Neo.ConsoleService/Neo.ConsoleService.csproj::TargetFramework=net8.0]
2024-06-08T05:47:34.3024640Z /usr/share/dotnet/sdk/8.0.301/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.targets(284,5): error MSB4018:    at Interop.ThrowExceptionForIoErrno(ErrorInfo errorInfo, String path, Boolean isDirError) [/home/runner/work/neo/neo/src/Neo.ConsoleService/Neo.ConsoleService.csproj::TargetFramework=net8.0]
2024-06-08T05:47:34.3032948Z /usr/share/dotnet/sdk/8.0.301/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.targets(284,5): error MSB4018:    at Microsoft.Win32.SafeHandles.SafeFileHandle.Open(String fullPath, FileMode mode, FileAccess access, FileShare share, FileOptions options, Int64 preallocationSize, UnixFileMode openPermissions, Int64& fileLength, UnixFileMode& filePermissions, Boolean failForSymlink, Boolean& wasSymlink, Func`4 createOpenException) [/home/runner/work/neo/neo/src/Neo.ConsoleService/Neo.ConsoleService.csproj::TargetFramework=net8.0]
2024-06-08T05:47:34.3041386Z /usr/share/dotnet/sdk/8.0.301/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.targets(284,5): error MSB4018:    at System.IO.Strategies.OSFileStreamStrategy..ctor(String path, FileMode mode, FileAccess access, FileShare share, FileOptions options, Int64 preallocationSize, Nullable`1 unixCreateMode) [/home/runner/work/neo/neo/src/Neo.ConsoleService/Neo.ConsoleService.csproj::TargetFramework=net8.0]
2024-06-08T05:47:34.3048598Z /usr/share/dotnet/sdk/8.0.301/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.targets(284,5): error MSB4018:    at System.IO.File.Create(String path) [/home/runner/work/neo/neo/src/Neo.ConsoleService/Neo.ConsoleService.csproj::TargetFramework=net8.0]
2024-06-08T05:47:34.3053375Z /usr/share/dotnet/sdk/8.0.301/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.targets(284,5): error MSB4018:    at Microsoft.NET.Build.Tasks.GenerateDepsFile.WriteDepsFile(String depsFilePath) [/home/runner/work/neo/neo/src/Neo.ConsoleService/Neo.ConsoleService.csproj::TargetFramework=net8.0]
2024-06-08T05:47:34.3058088Z /usr/share/dotnet/sdk/8.0.301/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.targets(284,5): error MSB4018:    at Microsoft.NET.Build.Tasks.TaskBase.Execute() [/home/runner/work/neo/neo/src/Neo.ConsoleService/Neo.ConsoleService.csproj::TargetFramework=net8.0]
2024-06-08T05:47:34.3063029Z /usr/share/dotnet/sdk/8.0.301/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.targets(284,5): error MSB4018:    at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute() [/home/runner/work/neo/neo/src/Neo.ConsoleService/Neo.ConsoleService.csproj::TargetFramework=net8.0]
2024-06-08T05:47:34.3069169Z /usr/share/dotnet/sdk/8.0.301/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.targets(284,5): error MSB4018:    at Microsoft.Build.BackEnd.TaskBuilder.ExecuteInstantiatedTask(ITaskExecutionHost taskExecutionHost, TaskLoggingContext taskLoggingContext, TaskHost taskHost, ItemBucket bucket, TaskExecutionMode howToExecuteTask) [/home/runner/work/neo/neo/src/Neo.ConsoleService/Neo.ConsoleService.csproj::TargetFramework=net8.0]
2024-06-08T05:47:34.3189445Z /usr/share/dotnet/sdk/8.0.301/Microsoft.Common.CurrentVersion.targets(1197,5): warning MSB3191: Unable to create directory "/bin/Neo.IO/Release/net8.0/". Access to the path '/bin/Neo.IO' is denied. [/home/runner/work/neo/neo/src/Neo.IO/Neo.IO.csproj::TargetFramework=net8.0]
2024-06-08T05:47:34.4297011Z /usr/share/dotnet/sdk/8.0.301/Microsoft.Common.CurrentVersion.targets(1197,5): warning MSB3191: Unable to create directory "/bin/Neo.VM/Release/net8.0/". Access to the path '/bin/Neo.VM' is denied. [/home/runner/work/neo/neo/src/Neo.VM/Neo.VM.csproj::TargetFramework=net8.0]
2024-06-08T05:47:34.6052483Z /usr/share/dotnet/sdk/8.0.301/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.targets(284,5): error MSB4018: The "GenerateDepsFile" task failed unexpectedly. [/home/runner/work/neo/neo/src/Neo.Json/Neo.Json.csproj::TargetFramework=net8.0]
2024-06-08T05:47:34.6058683Z /usr/share/dotnet/sdk/8.0.301/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.targets(284,5): error MSB4018: System.IO.DirectoryNotFoundException: Could not find a part of the path '/bin/Neo.Json/Release/net8.0/Neo.Json.deps.json'. [/home/runner/work/neo/neo/src/Neo.Json/Neo.Json.csproj::TargetFramework=net8.0]
2024-06-08T05:47:34.6064337Z /usr/share/dotnet/sdk/8.0.301/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.targets(284,5): error MSB4018:    at Interop.ThrowExceptionForIoErrno(ErrorInfo errorInfo, String path, Boolean isDirError) [/home/runner/work/neo/neo/src/Neo.Json/Neo.Json.csproj::TargetFramework=net8.0]
2024-06-08T05:47:34.6071777Z /usr/share/dotnet/sdk/8.0.301/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.targets(284,5): error MSB4018:    at Microsoft.Win32.SafeHandles.SafeFileHandle.Open(String fullPath, FileMode mode, FileAccess access, FileShare share, FileOptions options, Int64 preallocationSize, UnixFileMode openPermissions, Int64& fileLength, UnixFileMode& filePermissions, Boolean failForSymlink, Boolean& wasSymlink, Func`4 createOpenException) [/home/runner/work/neo/neo/src/Neo.Json/Neo.Json.csproj::TargetFramework=net8.0]
2024-06-08T05:47:34.6079662Z /usr/share/dotnet/sdk/8.0.301/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.targets(284,5): error MSB4018:    at System.IO.Strategies.OSFileStreamStrategy..ctor(String path, FileMode mode, FileAccess access, FileShare share, FileOptions options, Int64 preallocationSize, Nullable`1 unixCreateMode) [/home/runner/work/neo/neo/src/Neo.Json/Neo.Json.csproj::TargetFramework=net8.0]
2024-06-08T05:47:34.6094650Z /usr/share/dotnet/sdk/8.0.301/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.targets(284,5): error MSB4018:    at System.IO.File.Create(String path) [/home/runner/work/neo/neo/src/Neo.Json/Neo.Json.csproj::TargetFramework=net8.0]
2024-06-08T05:47:34.6098934Z /usr/share/dotnet/sdk/8.0.301/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.targets(284,5): error MSB4018:    at Microsoft.NET.Build.Tasks.GenerateDepsFile.WriteDepsFile(String depsFilePath) [/home/runner/work/neo/neo/src/Neo.Json/Neo.Json.csproj::TargetFramework=net8.0]
2024-06-08T05:47:34.6103127Z /usr/share/dotnet/sdk/8.0.301/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.targets(284,5): error MSB4018:    at Microsoft.NET.Build.Tasks.TaskBase.Execute() [/home/runner/work/neo/neo/src/Neo.Json/Neo.Json.csproj::TargetFramework=net8.0]
2024-06-08T05:47:34.6107741Z /usr/share/dotnet/sdk/8.0.301/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.targets(284,5): error MSB4018:    at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute() [/home/runner/work/neo/neo/src/Neo.Json/Neo.Json.csproj::TargetFramework=net8.0]
2024-06-08T05:47:34.6114050Z /usr/share/dotnet/sdk/8.0.301/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.targets(284,5): error MSB4018:    at Microsoft.Build.BackEnd.TaskBuilder.ExecuteInstantiatedTask(ITaskExecutionHost taskExecutionHost, TaskLoggingContext taskLoggingContext, TaskHost taskHost, ItemBucket bucket, TaskExecutionMode howToExecuteTask) [/home/runner/work/neo/neo/src/Neo.Json/Neo.Json.csproj::TargetFramework=net8.0]
2024-06-08T05:47:35.7232851Z /usr/share/dotnet/sdk/8.0.301/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.targets(284,5): error MSB4018: The "GenerateDepsFile" task failed unexpectedly. [/home/runner/work/neo/neo/src/Neo.VM/Neo.VM.csproj::TargetFramework=net8.0]
2024-06-08T05:47:35.7238414Z /usr/share/dotnet/sdk/8.0.301/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.targets(284,5): error MSB4018: System.IO.DirectoryNotFoundException: Could not find a part of the path '/bin/Neo.VM/Release/net8.0/Neo.VM.deps.json'. [/home/runner/work/neo/neo/src/Neo.VM/Neo.VM.csproj::TargetFramework=net8.0]
2024-06-08T05:47:35.7244253Z /usr/share/dotnet/sdk/8.0.301/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.targets(284,5): error MSB4018:    at Interop.ThrowExceptionForIoErrno(ErrorInfo errorInfo, String path, Boolean isDirError) [/home/runner/work/neo/neo/src/Neo.VM/Neo.VM.csproj::TargetFramework=net8.0]
2024-06-08T05:47:35.7249376Z /usr/share/dotnet/sdk/8.0.301/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.targets(284,5): error MSB4018:    at Microsoft.Win32.SafeHandles.SafeFileHandle.Open(String fullPath, FileMode mode, FileAccess access, FileShare share, FileOptions options, Int64 preallocationSize, UnixFileMode openPermissions, Int64& fileLength, UnixFileMode& filePermissions, Boolean failForSymlink, Boolean& wasSymlink, Func`4 createOpenException) [/home/runner/work/neo/neo/src/Neo.VM/Neo.VM.csproj::TargetFramework=net8.0]
2024-06-08T05:47:35.7254982Z /usr/share/dotnet/sdk/8.0.301/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.targets(284,5): error MSB4018:    at System.IO.Strategies.OSFileStreamStrategy..ctor(String path, FileMode mode, FileAccess access, FileShare share, FileOptions options, Int64 preallocationSize, Nullable`1 unixCreateMode) [/home/runner/work/neo/neo/src/Neo.VM/Neo.VM.csproj::TargetFramework=net8.0]
2024-06-08T05:47:35.7259689Z /usr/share/dotnet/sdk/8.0.301/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.targets(284,5): error MSB4018:    at System.IO.File.Create(String path) [/home/runner/work/neo/neo/src/Neo.VM/Neo.VM.csproj::TargetFramework=net8.0]
2024-06-08T05:47:35.7263461Z /usr/share/dotnet/sdk/8.0.301/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.targets(284,5): error MSB4018:    at Microsoft.NET.Build.Tasks.GenerateDepsFile.WriteDepsFile(String depsFilePath) [/home/runner/work/neo/neo/src/Neo.VM/Neo.VM.csproj::TargetFramework=net8.0]
2024-06-08T05:47:35.7267401Z /usr/share/dotnet/sdk/8.0.301/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.targets(284,5): error MSB4018:    at Microsoft.NET.Build.Tasks.TaskBase.Execute() [/home/runner/work/neo/neo/src/Neo.VM/Neo.VM.csproj::TargetFramework=net8.0]
2024-06-08T05:47:35.7272166Z /usr/share/dotnet/sdk/8.0.301/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.targets(284,5): error MSB4018:    at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute() [/home/runner/work/neo/neo/src/Neo.VM/Neo.VM.csproj::TargetFramework=net8.0]
2024-06-08T05:47:35.7279674Z /usr/share/dotnet/sdk/8.0.301/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.targets(284,5): error MSB4018:    at Microsoft.Build.BackEnd.TaskBuilder.ExecuteInstantiatedTask(ITaskExecutionHost taskExecutionHost, TaskLoggingContext taskLoggingContext, TaskHost taskHost, ItemBucket bucket, TaskExecutionMode howToExecuteTask) [/home/runner/work/neo/neo/src/Neo.VM/Neo.VM.csproj::TargetFramework=net8.0]
2024-06-08T05:47:35.7970615Z ##[error]Process completed with exit code 1.

Regression?

No response

Known Workarounds

No response

Configuration

github actions

Other information

No response

dotnet-policy-service[bot] commented 1 month ago

Tagging subscribers to this area: @vitek-karas, @agocke See info in area-owners.md if you want to be subscribed.

hoyosjs commented 1 month ago

I don't think this is the right repo for this issue - this is an SDK or MSBuild issue. That being said - is the lack of a line separator of after --version-suffix 3.7.5 just a typo on the sample?

cschuchardt88 commented 1 month ago

Yes just a typo.

rainersigwald commented 1 month ago

Possible this is an SDK-argument-processing error instead of at the MSBuild layer but there should not be any OS difference in this behavior.

cschuchardt88 commented 1 month ago

Maybe not so much OS problem.

When I run simple command like below only with *.csproj file.

dotnet publish --output ../out -p:BaseOutputPath=/bin

Command will make a folder with different name like below at the root of the drive. image

baronfel commented 1 month ago

--output for the dotnet publish command only sets the PublishDir property - this property is normally derived from BaseOutputPath, but when set explicitly like this it cannot be overridden.

Similarly with -p:BaseOutputPath=/bin - with this you are telling the build to use /bin in your root. If you meant bin directory relative to the current directory you need to specify a relative path, like -p:BaseOutputPath=./bin or similar. In addition, currently a BaseOutputPath is assumed to be /-terminated, which is why you see the odd /binRelease directory - because we don't generally expect folks to set BaseOutputPath we didn't guard against this. If you choose to set BaseOutputPath I'd suggest putting a trailing / for safety/consistency.

cschuchardt88 commented 1 month ago

Any reason why $(SolutionDir) wouldn't be the current working directory? Without being empty; if specifying a *.csproj file.

Lastly, for example if I had

<BaseOutputPath>$(SolutionDir)/bin/$(ProjectName)</BaseOutputPath>

In *.props both SolutionDir and ProjectName would be empty when specifying a *.csproj file.

baronfel commented 1 month ago

SolutionDir isn't something that folks should be relying on in project files - it's only ever set if the project is built as part of a solution, which is not always the case. We do not recommend its use in project-specific code partly because of that.