You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Allow exact duplicate input entries when bundling single file (#50476)
SDK can (and will) produce inputs for bundling which contain exact duplicate entries (same source path and same target relative path). Currently publishing such app as non-single-file works just fine (files are overwritten), but publishing it as single-file fails.
Fixing this in the SDK seems like a rather complex problem - see dotnet/sdk#16576 for more details.
There's no harm in allowing exact duplicates and ignoring them when bundling (only one copy of the file is bundled) as that will be the same behavior as non-single-file publish.
If the duplicates are not exact (different source path) then still reject those. SDK currently allows that, but it's very problematic (effectively random output).
thrownewArgumentException($"Invalid input specification: Found entries {fileSpecPaths} with the same BundleRelativePath '{bundleRelativePathCollision.Key}'");
thrownewArgumentException($"Invalid input specification: Found entries '{fileSpec.SourcePath}' and '{existingFileSpec.SourcePath}' with the same BundleRelativePath '{fileSpec.BundleRelativePath}'");
311
+
}
312
+
313
+
// Exact duplicate - intentionally skip and don't include a second copy in the bundle
Copy file name to clipboardExpand all lines: src/installer/tests/Microsoft.NET.HostModel.Tests/Microsoft.NET.HostModel.Bundle.Tests/BundlerConsistencyTests.cs
+80Lines changed: 80 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -70,6 +70,34 @@ public void TestWithoutSpecifyingHostFails()
0 commit comments