microsoft / WindowsAppSDK

The Windows App SDK empowers all Windows desktop apps with modern Windows UI, APIs, and platform features, including back-compat support, shipped via NuGet.
https://docs.microsoft.com/windows/apps/windows-app-sdk/
MIT License
3.85k stars 326 forks source link

Migrate UWP App to Windows SDK: Error after update with MSIX #3338

Open vagisha-nidhi195 opened 1 year ago

vagisha-nidhi195 commented 1 year ago

Describe the bug

I currently have a UWP App. I want to update this to WindowsAppSDK project. I am testing deployment of the app. I created a sample app and installed msixupload bundle file. After I migrate to windows app sdk and then installing the updated version of the app using sideload, I get deployment errors.

Steps to reproduce the bug

  1. Generate a sample UWP app
  2. Install the app with app version X
  3. With upgrade assistant tool, migrate the app to windows sdk
  4. Make sure the certificate remains same
  5. Check if the windows sdk project builds
  6. Update the version (greater than X) of the windows sdk generated using upgrade assistant and try to install

After installing the msix-Update, an error appears:

ierror
AppX Deployment operation failed for package 36148Vagisha.BasicUWPApp_1.0.10.0_x64__4mc14ffpd8dt0 with error 0x80073CF3. The specific error text for this failure is: Deployment Add operation with target volume C: on Package 36148Vagisha.BasicUWPApp_1.0.10.0_x64__4mc14ffpd8dt0 from:  (BasicUWPApp_1.0.10.0_x64_Debug.msix)  failed with error 0x80073CF3. See http://go.microsoft.com/fwlink/?LinkId=235160 for help diagnosing app deployment issues

Interesting this is that when the UWP app is not installed (that is I try to do a fresh install of the app) - I get no issues with installation of windows sdk project

Also when I try to do the opposite, that is 1st install the SDK app and then the UWP, that works fine as well, no issue with update. When I update from SDK (old version) to SDK (new version) => this also works well. Only case not working is UWP (old version) to SDK (new version) which I need for migration from UWP to SDK.

I have looked at event viewer and don't have any information. Is there some kind of setting I am missing?

Expected behavior

The app should update without deployment errors when updating from UWP to SDK.

Screenshots

No response

NuGet package version

Windows App SDK 1.2.2: 1.2.221209.1

Packaging type

Packaged (MSIX)

Windows version

Windows 10 version 22H2 (19045, 2022 Update)

IDE

Visual Studio 2022

Additional context

No response

mominshaikhdevs commented 3 weeks ago

Microsoft's "Package Deployment Manager" Wizard @DrusTheAxe knows better.

DrusTheAxe commented 1 week ago

0x80073CF3=ERROR_INSTALL_RESOLVE_DEPENDENCY_FAILED

That means your package's appxmanifest.xml declares a <PackageDependency> that could be satisfied by the packages available on the system when you tried to install.

At a guess, you have WinAppSDK 1.2.2 installed and the package you're trying to install manifests <PackageDependency Name="Microsoft.WindowsAppRuntime.1.2" ... MinVersion="...version..."> where version is the MSIX package version for 1.2.3+?

Your manifested package depednencies can be satisfied by what's currently on the machine and additional packages (if any) passed to the PackageManager API via the DependencyPackageUris parameter. When you 'run' a .msix[bundle] Windows will run the app associated with the .msix[bundle] file type passing your package as a parameter to the app. Windows includes the 'App Installer' app which defines file type associations for MSIX file types (.msix, .msixbundle, more) and the AppInstaller app has no additional packages to pass to PackageManager.AppPackageAsync(...DependencyPackageUris...).

You can get more details about the failure (e.g. the dependency that couldn't be satisfied) if you review the eventlog's Microsoft-Windows-AppxDeploymentServer/Operational channel. You'll see some half-dozen plus events for your requested operation. Check the 1st error between the event starting the request for your package and reporting it failed.

If you're manifesting a dependency on a newer package than present on the machine and the Store installs your package the Store knows about dependencies hosted on the Store and will update them as necessary along with your package to satisfy your dependency. If you install via AppInstaller that doesn't automagically resolve your dependencies against the Store's content. AppInstaller calls PackageManager APIs (e.g. AddPackageByUriAsync) so control goes from the AppInstaller app to Windows' MSIX Deployment pipline. OTOH installing via the Store app control goes from Store to MSIX Deployment pipeline. As AppInstaller doesn't involve Store in the install flow AppInstaller doesn't get the benefit of Store hosted packages automagically installed if/when needed to satisfy dependencies. In this case you need to install your dependencies before installing your package via AppInstaller.