This issue has been moved from a ticket on Developer Community.
[severity:It's more difficult to complete my work]
-
Create a .NET MAUI App targeting:
net10.0-android; net10.0-ios; net10.0-maccatalyst; net10.0-windows10.0.19041.0
-
Create a MAUI Class Library targeting the same TFMs (multi-TFM MAUI library)
-
Add platform-specific code using #if WINDOWS (works correctly when multi-targeted)
-
Reference the library from the MAUI app
-
In Visual Studio:
Build → Publish → Create App Packages → MSIX
-
Build fails with:
“Payload contains two or more files with the same destination path ‘<LibraryName>.pdb’”
OR
“Metadata file ‘MauiLib.dll’ not found”
OR
other payload duplication errors
-
BUT running this works correctly:
dotnet publish -f net10.0-windows10.0.19041.0 -c Release
Visual Studio Publish fails. CLI publish succeeds.
This has been an issue for 2 years.
Original Comments
Feedback Bot on 12/4/2025, 01:47 PM:
We have directed your feedback to the appropriate engineering team for further evaluation. The team will review the feedback and notify you about the next steps.