Skip to content

MSIX Publish Fails in Visual Studio When Project References Multi-Target MAUI Class Library #33255

@vsfeedback

Description

@vsfeedback

This issue has been moved from a ticket on Developer Community.


[severity:It's more difficult to complete my work]

  1. Create a .NET MAUI App targeting:
    net10.0-android; net10.0-ios; net10.0-maccatalyst; net10.0-windows10.0.19041.0

  2. Create a MAUI Class Library targeting the same TFMs (multi-TFM MAUI library)

  3. Add platform-specific code using #if WINDOWS (works correctly when multi-targeted)

  4. Reference the library from the MAUI app

  5. In Visual Studio:
    Build → Publish → Create App Packages → MSIX

  6. 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

  7. 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions