SOLVED

Application crash on Windows 10 Enterprise LTSC when using AppInstaller

%3CLINGO-SUB%20id%3D%22lingo-sub-3004853%22%20slang%3D%22en-US%22%3EApplication%20crash%20on%20Windows%2010%20Enterprise%20LTSC%20when%20using%20AppInstaller%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-3004853%22%20slang%3D%22en-US%22%3E%3CP%3EI%20have%20a%20.NET%20Windows%20Forms%20app%20packaged%20with%20MSIX%20and%20Automatic%20Updates%20configured%20using%20the%20AppInstaller%20feature.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EIt%20works%20fine%20on%20Windows%2010%20Professional%20edition%2C%20but%20my%20target%20version%20is%26nbsp%3BWindows%2010%20Enterprise%20LTSC%20version%201809.%20Here%20t%3CSPAN%3Ehe%20app%20crashes%20on%20startup.%20Error%20details%20from%20Event%20Viewer%3A%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CEM%3EFaulting%20application%20name%3A%20MyApp.exe%2C%20version%3A%200.1.0.104%2C%20time%20stamp%3A%200x6194a27a%3C%2FEM%3E%3CBR%20%2F%3E%3CEM%3EFaulting%20module%20name%3A%20RPCRT4.dll%2C%20version%3A%2010.0.17763.2237%2C%20time%20stamp%3A%200x06296516%3C%2FEM%3E%3CBR%20%2F%3E%3CEM%3EException%20code%3A%200xc0000005%3C%2FEM%3E%3CBR%20%2F%3E%3CEM%3EFault%20offset%3A%200x000000000002dbc7%3C%2FEM%3E%3CBR%20%2F%3E%3CEM%3EFaulting%20process%20ID%3A%200x1fe0%3C%2FEM%3E%3CBR%20%2F%3E%3CEM%3EFaulting%20application%20start%20time%3A%200x01d7e1d1d8ee79b3%3C%2FEM%3E%3CBR%20%2F%3E%3CEM%3EFaulting%20application%20path%3A%20C%3A%5CProgram%20Files%5CWindowsApps%5CMyApp.1.0.104_neutral__nz9tp4yz656p2%5CMyApp%5CMyApp.exe%3C%2FEM%3E%3CBR%20%2F%3E%3CEM%3EFaulting%20module%20path%3A%20C%3A%5CWindows%5CSystem32%5CRPCRT4.dll%3C%2FEM%3E%3CBR%20%2F%3E%3CEM%3EReport%20ID%3A%20ea9c6804-f5c4-4ddc-8ee0-c79fd012f3cd%3C%2FEM%3E%3CBR%20%2F%3E%3CEM%3EFaulting%20package%20full%20name%3A%20MyApp_0.1.0.104_neutral__nz9tp4yz656p2%3C%2FEM%3E%3CBR%20%2F%3E%3CEM%3EFaulting%20package-relative%20application%20ID%3A%20App%3C%2FEM%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EFrom%20what%20I%20read%20%3CEM%3ERPCRT4.dll%26nbsp%3B%3C%2FEM%3Eis%20related%20to%20RPC%20calls.%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThis%20is%20how%20the%20app%20is%20installed%20using%20Powershell.%20Files%20are%20hosted%20on%20az%20Azure%20App%20Service.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CPRE%20class%3D%22lia-code-sample%20language-powershell%22%3E%3CCODE%3EAdd-AppPackage%20-AppInstallerFile%20https%3A%2F%2Fmy-domain.com%2FMyApp.appinstaller%3C%2FCODE%3E%3C%2FPRE%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EIf%20I%20install%20the%20app%20using%20the%26nbsp%3B%3CEM%3E*.msixbundle%26nbsp%3B%3C%2FEM%3Efile%2C%20it%20works.%20But%20I%20lose%20automatic%20updates%20this%20way.%20This%20means%20that%20the%20issue%20is%20not%20in%20the%20application%20code%2C%20it's%20related%20to%20MSIX.%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CPRE%20class%3D%22lia-code-sample%20language-powershell%22%3E%3CCODE%3EAdd-AppXPackage%20https%3A%2F%2Fmy-domain.com%2FMyApp_0.1.0.104_Test%2FMyApp_0.1.0.104_AnyCPU.msixbundle%3C%2FCODE%3E%3C%2FPRE%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ESomething%20to%20do%20with%20the%20AppInstaller%2C%20it%20seems%20to%20fail%20when%20checking%20for%20updates%3F%20Maybe%20some%20kind%20of%20permission%20missing%3F%20Already%20tried%20running%20as%20Administrator.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EBased%20on%20the%20Supported%20Platforms%20documentation%2C%20Windows%2010%20Enterprise%20LTSC%20should%20have%20support%20for%20AppInstaller.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fwindows%2Fmsix%2Fsupported-platforms%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3Ehttps%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fwindows%2Fmsix%2Fsupported-platforms%3C%2FA%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-3013383%22%20slang%3D%22en-US%22%3ERe%3A%20Application%20crash%20on%20Windows%2010%20Enterprise%20LTSC%20when%20using%20AppInstaller%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-3013383%22%20slang%3D%22en-US%22%3E%3CP%3EIt%20seems%20like%20Windows%2010%20Enterprise%20LTSC%20build%201809%20doesn't%20support%20checking%20for%20updates%20programmatically.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20followed%20the%20description%20from%20here%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fwindows-dev-appconsult%2Fhandling-application-updates-with-app-installer-and-msix-in%2Fba-p%2F355389%22%20target%3D%22_blank%22%3Ehttps%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fwindows-dev-appconsult%2Fhandling-application-updates-with-app-installer-and-msix-in%2Fba-p%2F355389%3C%2FA%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CPRE%20class%3D%22lia-code-sample%20language-csharp%22%3E%3CCODE%3Eprivate%20async%20Task%20CheckForUpdates()%0A%7B%0A%20%20%20%20var%20result%20%3D%20await%20Package.Current.CheckUpdateAvailabilityAsync()%3B%0A%20%20%20%20if%20(result.Availability%20%3D%3D%20PackageUpdateAvailability.Available)%0A%20%20%20%20%7B%0A%20%20%20%20%20%20%20%20MessageBox.Show(%22There's%20a%20new%20update!%20Restart%20your%20app%20to%20install%20it%22)%3B%0A%20%20%20%20%7D%0A%7D%3C%2FCODE%3E%3C%2FPRE%3E%3CP%3EIt%20crashes%20the%20app%2C%20even%20though%20I%20have%20global%20error%20handling%20configured.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EAfter%20I%20removed%20the%20code%20and%20related%20DLLs%2C%20the%20app%20installer%20is%20working.%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E
Occasional Contributor

I have a .NET Windows Forms app packaged with MSIX and Automatic Updates configured using the AppInstaller feature.

 

It works fine on Windows 10 Professional edition, but my target version is Windows 10 Enterprise LTSC version 1809. Here the app crashes on startup. Error details from Event Viewer:

 

Faulting application name: MyApp.exe, version: 0.1.0.104, time stamp: 0x6194a27a
Faulting module name: RPCRT4.dll, version: 10.0.17763.2237, time stamp: 0x06296516
Exception code: 0xc0000005
Fault offset: 0x000000000002dbc7
Faulting process ID: 0x1fe0
Faulting application start time: 0x01d7e1d1d8ee79b3
Faulting application path: C:\Program Files\WindowsApps\MyApp.1.0.104_neutral__nz9tp4yz656p2\MyApp\MyApp.exe
Faulting module path: C:\Windows\System32\RPCRT4.dll
Report ID: ea9c6804-f5c4-4ddc-8ee0-c79fd012f3cd
Faulting package full name: MyApp_0.1.0.104_neutral__nz9tp4yz656p2
Faulting package-relative application ID: App

 

From what I read RPCRT4.dll is related to RPC calls. 

 

This is how the app is installed using Powershell. Files are hosted on az Azure App Service.

 

 

 

Add-AppPackage -AppInstallerFile https://my-domain.com/MyApp.appinstaller

 

 

If I install the app using the *.msixbundle file, it works. But I lose automatic updates this way. This means that the issue is not in the application code, it's related to MSIX. 

 

 

Add-AppXPackage https://my-domain.com/MyApp_0.1.0.104_Test/MyApp_0.1.0.104_AnyCPU.msixbundle

 

 

Something to do with the AppInstaller, it seems to fail when checking for updates? Maybe some kind of permission missing? Already tried running as Administrator.

 

Based on the Supported Platforms documentation, Windows 10 Enterprise LTSC should have support for AppInstaller.

 

 

 

https://docs.microsoft.com/en-us/windows/msix/supported-platforms

 

2 Replies

It seems like Windows 10 Enterprise LTSC build 1809 doesn't support checking for updates programmatically.

 

I followed the description from here https://techcommunity.microsoft.com/t5/windows-dev-appconsult/handling-application-updates-with-app-...

 

private async Task CheckForUpdates()
{
    var result = await Package.Current.CheckUpdateAvailabilityAsync();
    if (result.Availability == PackageUpdateAvailability.Available)
    {
        MessageBox.Show("There's a new update! Restart your app to install it");
    }
}

It crashes the app, even though I have global error handling configured.

 

After I removed the code and related DLLs, the app installer is working. 

best response confirmed by szilardd (Occasional Contributor)
Solution

I got it working using the `Microsoft.Windows.SDK.Contracts` NuGet package instead of the approach described above (had to convert from package.config to PackageReference)

https://docs.microsoft.com/en-us/windows/apps/desktop/modernize/desktop-to-uwp-enhance#earlier-versi...

Sample code

 

var packageManager = new PackageManager();
var currentPackage = packageManager.FindPackageForUser(string.Empty, Package.Current.Id.FullName);
var result = await currentPackage.CheckUpdateAvailabilityAsync();

if (result.ExtendedError != null) {
    LogError("Update availability error", result.ExtendedError);
}

var hasUpdate = (result.Availability == PackageUpdateAvailability.Available);

if (hasUpdate) {
    // there is an update available
}