Search code examples
c#mauimsix

.net MAUI dependencies


I need to submit a project written in .Net MAUI to the Microsoft Store. One of the libraries I'm using requires VCLibs. How can I add the necessary dependencies?

Adding them to the *.csproj file didn't make any difference.

Adding them to the *.appmanifest file

<Dependencies>
    <TargetDeviceFamily Name="Windows.Universal" MinVersion="10.0.17763.0" MaxVersionTested="10.0.19041.0" />
    <PackageDependency MinVersion="14.0.30704.0" Name="Microsoft.VCLibs.140.00.UWPDesktop" Publisher="CN=Microsoft Corporation, O=Microsoft Corporation, L=Redmond, S=Washington, C=US" />
</Dependencies>

results in an C00CE014: App manifest validation error during the package build stage using dotnet build.


Solution

  • I found a workaround solution. It's not optimal, but it works.

    First, I don't add the dependencies and build the packages for submission using this code.

    Then, using the MSIX Packaging Tools, I edit the manifest file and add the dependencies in the Dependency block. It's important at this stage to add a key and sign the package before saving it.

    Next, I build the msixbundle using MakeAppx.exe and sign it using SignTool.