Search code examples
mauimsixappinstaller

Where to find logs for failed msix installation?


Situation

We created and signed a MSIX package of our .NET MAUI app for distribution outside MS Store and Installation with App-Installer.

Problem

While (up to now) most of testing users don`t have any problems with installation with MS App-Installer, in one case installation fails showing this message: "App Installer failed to install package dependencies. Ask the developer for -package[!]."

Tries

Because I don't have a clue, what package exactly could be missing, I searched for some error logs / error codes in Event Viewer (here: Application and Services Logs -> Microsoft -> Windows -> AppxDeployment-Server), following these instructions , but could not find anything in AppxDeployment-Server.

Could anyone please tell me, where else to find logs for failed msix installation? Or does maybe anyone could give me a suggestion, what could be the reason for the failing installation?


Solution

  • We found a solution that works in our context:

    • Getting Logs: While a failing Installation with AppInstaller did not leed to logs in Event Viewer, Installation with Power Shell was more verbose and so we could figure out that missing dependency was WindowsAppRuntime.
    • Adding WindowsAppRuntime: If users are logged in MS Store while performing installation of the app, missing dependency is fulfilled automatically by Store. For we would like to allow an installation outside MS Store we had to find another solution. So we added following lines to our *.csproj for using WASDK as self-contained:
    • <WindowsAppSDKSelfContained>true</WindowsAppSDKSelfContained> and
    • <Target Name="_RemoveFrameworkReferences" BeforeTargets="_ConvertItems;>_CalculateInputsForGenerateCurrentProjectAppxManifest"> <ItemGroup> <FrameworkSdkReference Remove="@(FrameworkSdkReference)" Condition="$([System.String]::Copy('%(FrameworkSdkReference.SDKName)').StartsWith('Microsoft.WindowsAppRuntime.'))" /> </ItemGroup> </Target>

    as described here. Unfortunaley this causes a error "The platform 'AnyCPU' is not supported for Self Contained mode" so we had to add "-p:Platform=... option to our dotnet publish command as described here. For being able to start our program in VS we also had to add <Platforms>AnyCPU;x64</Platforms> solution wide to all of the *.csproj files with VS Configuration Manager.