question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Error in Create App Packages for Microsoft Store from a .wapproj

See original GitHub issue

Describe the bug Creating app packages for MS store using a Packaging project with a UWP app fails with an error about Microsoft.UI.Xaml\Assets\NoiseAsset_256X256_PNG.png

Steps to reproduce the bug

Steps to reproduce the behavior:

  1. Create a new solution.
  2. Add a new UWP app
  3. Add a dependency on the Nuget package Microsoft.UI.Xaml.2.5.0-prerelease.201027002
  4. Add a new UWP project of type Windows Application Packaging Project called Package
  5. Add the UWP app project to the Package project, and make it an entry point
  6. Publish the Package project under a MS developer account using Create App Packages
  7. Select Microsoft Store option, and use a reserved app name.
  8. Set options to never generate an app bundle, select only x64 architecture, and click Create.
  9. Observe the following errors in the output console
1>Package -> C:\Users\MyUser\source\repos\App1\Package\AppPackages\Package_1.0.6.0_x64_Test\Package_1.0.6.0_x64.msix
1>C:\Program Files (x86)\Windows Kits\10\bin\10.0.18362.0\x64\MakeAppx.exe pack /l /h sha256 /f obj\x64\Release\upload.package.map.txt /o /p C:\Users\MyUser\source\repos\App1\Package\bin\x64\Release\Upload\Package_1.0.6.0_x64\Package_1.0.6.0_x64.msix  
1>You can't add both "C:\Users\MyUser\source\repos\App1\App2\bin\x64\Release\Microsoft.UI.Xaml\Assets\NoiseAsset_256X256_PNG.png" and "C:\Users\MyUser\.nuget\packages\microsoft.ui.xaml\2.5.0-prerelease.201027002\runtimes\win10-x64\native\Microsoft.UI.Xaml\Assets\NoiseAsset_256X256_PNG.png" to the output file as "Microsoft.UI.Xaml\Assets\NoiseAsset_256X256_PNG.png".
1>The mapping file can't be parsed.  The error occurs at line 185.
1>Package creation failed.
1>0x8007000b - An attempt was made to load a program with an incorrect format.

Expected behavior VS should successfully create an .msixupload package for certification and submission.

NuGet package version: [Microsoft.UI.Xaml.2.5.0-prerelease.201027002]

Windows app type:

UWP Win32
Yes
Windows 10 version Saw the problem?
Insider Build (xxxxx)
May 2020 Update (19041) Yes
November 2019 Update (18363)
May 2019 Update (18362)
October 2018 Update (17763)
April 2018 Update (17134)
Fall Creators Update (16299)
Creators Update (15063)
Device form factor Saw the problem?
Desktop Yes
Xbox
Surface Hub
IoT

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:20 (14 by maintainers)

github_iconTop GitHub Comments

1reaction
stevenbrixcommented, Nov 21, 2020

Agreed, in the meantime @sis2004 can you try this workaround and let me know if this works for you:

<!-- This is a workaround for  https://github.com/microsoft/microsoft-ui-xaml/issues/3554 -->
  <Target Name="WorkaroundForIssue3554" BeforeTargets="_GenerateAppxUploadPackageFile" Returns="@(AppxUploadPackagePayload)">
    <ItemGroup>
      <!-- There is a duplicate of the noiseasset file. This happy little piece of code finds the duplicates-->
      <_FilteredAppxPackagePayload Include="@(AppxUploadPackagePayload)" Condition="'%(AppxUploadPackagePayload.TargetPath)'=='Microsoft.UI.Xaml\Assets\NoiseAsset_256X256_PNG.png'"/>
      
      <!-- This happy piece of code arbitrarily remove one of the duplicates based on some metadata that we can use to distinguish one of them. -->
      <_AppxPackagePayloadToRemove Include="@(_FilteredAppxPackagePayload)" Condition="'%(_FilteredAppxPackagePayload.ProjectName)'==''"/>

      <!-- Finally, remove one of the duplicates from the actual item group that's causing problems. This is the happiest of all the little code pieces. -->
      <AppxUploadPackagePayload Remove="@(_AppxPackagePayloadToRemove)"/>
    </ItemGroup>
  </Target>
0reactions
github-actions[bot]commented, Jul 29, 2023

This issue is stale because it has been open 180 days with no activity. Remove stale label or comment or this will be closed in 5 days.

Read more comments on GitHub >

github_iconTop Results From Across the Web

WAP Capabilities missing
I am building an MSIX project using the Windows Application Package under Visual Studio. The application exe is an administrator tool that ...
Read more >
Can't create app packages for a Windows Application ...
Running Create App Packages for my Windows Application Packaging (Desktop Bridge) project stopped working in 16.3. Specifically, I get an error when running ......
Read more >
Windows App Store Package Creation Breakdown and ...
Make sure your app qualifies to be built with a Windows Store type installer. Your app has to meet a certain Microsoft standard...
Read more >
Packaging project fails with mismatch between the ...
Select the packaging project in solution explorer. Project > Publish > Create app package. "Microsoft Store as..." (you'll need to associate it ...
Read more >
Deploying a .NET desktop application using MSIX
In this post, I describe how to deploy a WPF or WinForms application using MSIX.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found