Skip to content

Conversation

@hoyosjs
Copy link
Member

@hoyosjs hoyosjs commented Jul 16, 2025

578eba8 normalized the output path for shims in the pack as tool scenario. However, the publish scenario is unnormalized and the two end up with colliding assets due to path separators. The easiest fix seems to be normalizing all paths.

578eba8 normalized the output path for shims in the pack as tool scenario. However, the publish scenario is unnormalized and the two end up with colliding assets due to path separators. The easiest fix seems to be normalizing all paths.
Copilot AI review requested due to automatic review settings July 16, 2025 09:40
@hoyosjs hoyosjs requested review from a team as code owners July 16, 2025 09:40
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR fixes a path normalization issue in the publish scenario for .NET SDK tools where unnormalized shim output directories were causing asset collisions due to inconsistent path separators. The fix aligns the publish scenario with a previous normalization applied to the pack as tool scenario.

  • Normalizes the PackagedShimOutputDirectory path using System.IO.Path.Combine() instead of string concatenation
  • Ensures consistent path formatting between pack and publish scenarios to prevent asset collisions

@akoeplinger akoeplinger merged commit cf32126 into main Jul 16, 2025
28 checks passed
@akoeplinger akoeplinger deleted the hoyosjs-patch-1 branch July 16, 2025 14:59
akoeplinger added a commit that referenced this pull request Jul 18, 2025
…tory

Follow-up to #49801 and #49288

We were still seeing an error during publish, note the duplicate slashes:

```
error NETSDK1152: Found multiple publish output files with the same relative path: /__w/1/s/artifacts/bin/dotnet-dump/Debug/shims/net8.0/win-x64/dotnet-dump.exe, /__w/1/s/artifacts/bin/dotnet-dump/Debug//shims/net8.0/win-x64/dotnet-dump.exe, /__w/1/s/artifacts/bin/dotnet-dump/Debug/shims/net8.0/win-x86/dotnet-dump.exe, /__w/1/s/artifacts/bin/dotnet-dump/Debug//shims/net8.0/win-x86/dotnet-dump.exe, /__w/1/s/artifacts/bin/dotnet-dump/Debug/shims/net8.0/osx-x64/dotnet-dump
```

Use the [MSBuild]::NormalizePath property function instead of Path.Combine to get a canonicalized path that doesn't contain duplicate slashes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants