Closed martincostello closed 9 months ago
I've also just run into this issue on my build pipeline
The issue seems that we are using OutputPath
which concatenates the paths incorrectly (no trailing slash). In the example from @martincostello:
OutDir = /workspaces/dotnet-patch-automation-sample/artifacts/
OutputPath = /workspaces/dotnet-patch-automation-sample/artifacts
I think we should just use OutDir
and it should work. cc @campersau
As a workaround add a trailing slash at the end of --output
.
You could also use EnsureTrailingSlash
.
OutDir |
OutputPath |
PublishDir |
|
---|---|---|---|
dotnet build |
:white_check_mark: bin/Debug/net8.0/ |
:white_check_mark: bin/Debug/net8.0/ |
:white_check_mark: bin/Debug/net8.0/publish/ |
dotnet build --output bin/Custom |
:white_check_mark: bin/Custom/ |
:x: bin/Custom |
:interrobang: bin/Custompublish/ |
dotnet publish |
:white_check_mark: bin/Release/net8.0/ |
:white_check_mark: bin/Release/net8.0/ |
:white_check_mark: bin/Release/net8.0/publish/ |
dotnet publish --output bin/Custom |
:white_check_mark: bin/Release/net8.0/ |
:white_check_mark: bin/Release/net8.0/ |
:x: bin/Custom |
So we could use OutDir
instead of OutputPath
but PublishDir
would always require $([MSBuild]::EnsureTrailingSlash('$(PublishDir)'))
.
I tried using OutDir
and it broke some of the tests. Wasn't reproducible locally tho, maybe some stray files: https://github.com/microsoft/playwright-dotnet/actions/runs/7557081073/job/20575513392
If it helps, most of my repos use the new .NET 8 artifacts output which may have contributed to the issue, though this issue has only affected some of them.
System info
Source code
Link to the GitHub repository with the repro
https://github.com/martincostello/dotnet-patch-automation-sample/commit/a41590758cadf4bc65b270cf05822d80bfadb0a5 in https://github.com/martincostello/dotnet-patch-automation-sample/pull/419
Steps
build.ps1
Expected
Code compiles and tests pass.
Actual
Build fails with error
MSB3073
:It appears that something is going wrong here:
https://github.com/microsoft/playwright-dotnet/blob/e964457aa770c39ecb8f3605da512791b6f527a9/src/Playwright/build/Microsoft.Playwright.targets#L65