title: Windows 10 UWP app closes/crashes immediately after splash screen
body: <p>I am used to code windows programs using the .net framework. However, since I need to implement a bluetooth low energy connection in my program I familiarized with the UWP and designed an UWP app to connect to a GATT server and read charateristics. The app is more or less based on <a href="https://github.com/Microsoft/Windows-universal-samples/tree/master/Samples/BluetoothLE" rel="nofollow noreferrer">this Windows BluetoothLE example</a>, but I deleted unused functions and got rid of the frame concept.
  I can compile and run this app using Visual Studio Community 2017 (15.9.9) on my laptop (Windows 10.0.17763). But I am not able to run this app on other laptops with Windows 10.0.17134, after I created the package and installed it there (prior to installing the developer mode was switched on). The app is available in the start menu and can be started, but I only see the splash screen for some seconds and then the app disappears.
  Interstingly, I succeded to pack, install and run the original BluetoothLE example as well as a very simple app with only one button based on the UWP template on a 10.0.17134 laptop. So the settings of the system(s) and the packaging process seem to be correct to sideload the app to another laptop.</p>
  
  <p>According to my research so far the problem may be caused by XAML properties in the MainPage.xaml, which can not be processed by the lower Windows version. The MainPage.xaml is:</p>
  
  <pre><code>&lt;Page
  x:Class="Bluetooth_UWP.MainPage"
  xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  xmlns:local="using:Bluetooth_UWP"
  xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
  xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  mc:Ignorable="d"
  Background="{ThemeResource ApplicationPageBackgroundThemeBrush}"&gt;
  
  &lt;Grid RequestedTheme="Default"  ScrollViewer.HorizontalScrollBarVisibility="Auto" Height="535" BorderBrush="DarkBlue" BorderThickness="3" Width="1050" VerticalAlignment="Stretch"  &gt;
      &lt;Grid.ColumnDefinitions&gt;
          &lt;ColumnDefinition Width="0*"/&gt;
          &lt;ColumnDefinition/&gt;
      &lt;/Grid.ColumnDefinitions&gt;
  
      &lt;Grid.RowDefinitions&gt;
          &lt;RowDefinition Height="80" /&gt;
          &lt;RowDefinition Height="300" /&gt;
          &lt;RowDefinition Height="*"/&gt;
      &lt;/Grid.RowDefinitions&gt;
      &lt;Button Grid.Row="0" x:Name="button_start" Content="Bluetooth Start" HorizontalAlignment="Left" Margin="13,0,0,0" VerticalAlignment="Center" Click="Button_Click" Height="33" Width="114" Grid.ColumnSpan="2"/&gt;
      &lt;Button Grid.Row="2" x:Name="button_send" Content="Send Hex" HorizontalAlignment="Left" Margin="826,92.6,0,0" VerticalAlignment="Top" Height="47" Width="211" Click="Button_send_Click" Grid.ColumnSpan="2"/&gt;
      &lt;TextBox Grid.Row="2" x:Name="Connection_Status" HorizontalAlignment="Left" Margin="13,35.6,0,0" Text="" VerticalAlignment="Top" Height="104" Width="500" AcceptsReturn="True" InputScope="Text" IsReadOnly="True" FontFamily="Lucida Console" TextChanged="Connection_Status_TextChanged" Grid.ColumnSpan="2"/&gt;
      &lt;TextBox Grid.Row="2" x:Name="Bluetooth_Rec_Text" HorizontalAlignment="Left" Margin="518,35.6,0,0" Text="" VerticalAlignment="Top" Height="105" Width="303" AcceptsReturn="True" InputScope="Text" IsReadOnly="True" FontFamily="Lucida Console" TextChanged="Bluetooth_Rec_Text_TextChanged" Grid.ColumnSpan="2"/&gt;
      &lt;TextBox Grid.Row="2" x:Name="Bluetooth_Send_Text" HorizontalAlignment="Left" Margin="826,35.6,0,0" Text=""  VerticalAlignment="Top" Height="52" Width="211" FontFamily="Lucida Console" TextChanged="Bluetooth_Send_Text_TextChanged" Grid.ColumnSpan="2"/&gt;
      &lt;TextBlock Grid.Row="2" x:Name="Text_Meldungen" HorizontalAlignment="Left" Margin="13,13.6,0,0" Text="Bluetooth-Meldungen:" TextWrapping="Wrap" VerticalAlignment="Top" Height="19" Width="140" Grid.ColumnSpan="2"/&gt;
      &lt;TextBlock Grid.Row="2" x:Name="Text_Empfangsdaten" HorizontalAlignment="Left" Margin="518,13.6,0,0" Text="Empfangsdaten:" TextWrapping="Wrap" VerticalAlignment="Top" Height="19" Width="99" Grid.ColumnSpan="2"/&gt;
      &lt;Image Grid.Row="1" x:Name="Sensorvisualisierung" HorizontalAlignment="Left" Height="64" Margin="13,35.6,0,0" VerticalAlignment="Top" Width="952" Stretch="None" Grid.ColumnSpan="2"/&gt;
      &lt;TextBlock Grid.Row="1" HorizontalAlignment="Left" Margin="13,13.6,0,0" Text="Biegung:" TextWrapping="Wrap" VerticalAlignment="Top" Grid.ColumnSpan="2"/&gt;
      &lt;Image Grid.Row="1" x:Name="Sensorvisualisierung_Torsion"  HorizontalAlignment="Left" Height="25" Margin="13,135.6,0,0" VerticalAlignment="Top" Width="952" Stretch="None" Grid.ColumnSpan="2"/&gt;
      &lt;TextBlock Grid.Row="1" HorizontalAlignment="Left" Margin="13,113.6,0,0" Text="Torsion" TextWrapping="Wrap" VerticalAlignment="Top" Grid.ColumnSpan="2"/&gt;
      &lt;CheckBox Grid.Row="1" x:Name="checkBox_Zahlen"  Content="Zahlen einblenden" HorizontalAlignment="Left" Margin="13,183.6,0,0" VerticalAlignment="Top" Grid.ColumnSpan="2"/&gt;
      &lt;TextBlock Grid.Row="1" x:Name="Text_Werte_Biegung_1" HorizontalAlignment="Left" Margin="11,46.6,0,0" Text="XX" TextWrapping="Wrap" VerticalAlignment="Top" FontSize="11" FontFamily="Lucida Console" Width="979" Grid.ColumnSpan="2"/&gt;
      &lt;TextBlock Grid.Row="1" x:Name="Text_Werte_Biegung_2" HorizontalAlignment="Left" Margin="11,78.6,0,0" Text="XX" TextWrapping="Wrap" VerticalAlignment="Top" FontSize="11" FontFamily="Lucida Console" Width="979" Grid.ColumnSpan="2"/&gt;
      &lt;TextBlock Grid.Row="1" x:Name="Text_Werte_Torsion" HorizontalAlignment="Left" Margin="11,145.6,0,0" Text="XX" TextWrapping="Wrap" VerticalAlignment="Top" FontSize="11" FontFamily="Lucida Console" Width="979" Grid.ColumnSpan="2"/&gt;
      &lt;ComboBox Grid.Row="0" x:Name="Sensorlaenge_List" ItemsSource="{x:Bind Sensorlaenge_Wahl}" DisplayMemberPath="" HorizontalAlignment="Left" Margin="150,0,0,0" Width="190" VerticalAlignment="Center" Visibility="Visible" SelectedIndex="0" SelectionChanged="Sensorlaenge_List_SelectionChanged" Grid.ColumnSpan="2"/&gt;
      &lt;RadioButton Grid.Row="0" x:Name="RadioButton_BT" Content="Bluetooth" HorizontalAlignment="Left" Margin="480,-32,0,0" VerticalAlignment="Center" Grid.ColumnSpan="2" Checked="RadioButton_Uebertragung_Checked" GroupName="RadioButton_Uebertragung" IsChecked="True"/&gt;
      &lt;RadioButton Grid.Row="0" x:Name="RadioButton_USB" Content="USB" HorizontalAlignment="Left" Margin="480,32,0,0" VerticalAlignment="Center" Grid.ColumnSpan="2" Checked="RadioButton_Uebertragung_Checked" GroupName="RadioButton_Uebertragung"/&gt;
      &lt;AppBarToggleButton Grid.Row="0" x:Name="Button_Messung_Start" HorizontalAlignment="Left" Label="Starte Messung" Margin="690,0,0,0" VerticalAlignment="Center" Width="130" Icon="Play"  Click="Button_Messung_Start_Click" Grid.ColumnSpan="2"/&gt;
      &lt;Button Grid.Row="0" x:Name="Button_Reset" Content="Kalibrierung" Grid.ColumnSpan="2" HorizontalAlignment="Left" Margin="360,0,0,0" VerticalAlignment="Center" Width="100" Click="Button_Reset_Click"/&gt;
      &lt;TextBox Grid.Row="0" x:Name="Messfrequenz" HorizontalAlignment="Left" Margin="600,40,0,0" Text="10" VerticalAlignment="Center" Grid.ColumnSpan="2" InputScope="Number" Width="64" TextChanged="Messfrequenz_TextChanged"/&gt;
      &lt;TextBlock Grid.ColumnSpan="2" x:Name="Text_Messfrequenz" HorizontalAlignment="Left" Margin="600,-30,0,0" Text="Messfrequenz:" TextWrapping="Wrap" VerticalAlignment="Center"/&gt;
      &lt;TextBlock Grid.ColumnSpan="2" x:Name="Text_Hz" HorizontalAlignment="Left" Margin="670,40,0,0" Text="Hz" TextWrapping="Wrap" VerticalAlignment="Center"/&gt;
      &lt;TextBlock Grid.ColumnSpan="2" x:Name="TexT_Bewegungsart" HorizontalAlignment="Left" Margin="10,235,0,0" Grid.Row="1" Text="Bewegung" TextWrapping="Wrap" VerticalAlignment="Top"/&gt;
  
  &lt;/Grid&gt;
  </code></pre>
  
  <p></p>
  
  <p>Is there a wrong statement or something missing?</p>
  
  <p>Furthermore I tried different changes in the Package.appxmanifest, like reducing the amount of assets-logos to the minimum, which does not help. Note that the bluetooth capability is included (I also tried the bluetooth.genericAttributeProfile, which didn't work and is now commented out). (The serial port part was another test not related to this problem.)</p>
  
  <pre><code>    &lt;?xml version="1.0" encoding="utf-8"?&gt;
     &lt;Package xmlns="http://schemas.microsoft.com/appx/manifest/foundation/windows10" xmlns:mp="http://schemas.microsoft.com/appx/2014/phone/manifest" xmlns:uap="http://schemas.microsoft.com/appx/manifest/uap/windows10" IgnorableNamespaces="uap mp"&gt;
    &lt;Identity Name="c6fb0f30-b3d7-4391-bf30-ee483792dc9c" Publisher="CN=Company" Version="0.1.40.0" /&gt;
    &lt;mp:PhoneIdentity PhoneProductId="c6fb0f30-b3d7-4391-bf30-ee483792dc9c" PhonePublisherId="00000000-0000-0000-0000-000000000000" /&gt;
    &lt;Properties&gt;
      &lt;DisplayName&gt;Bluetooth UWP Testsoftware&lt;/DisplayName&gt;
      &lt;PublisherDisplayName&gt;Company&lt;/PublisherDisplayName&gt;
      &lt;Logo&gt;Assets\StoreLogo.png&lt;/Logo&gt;
    &lt;/Properties&gt;
    &lt;Dependencies&gt;
      &lt;TargetDeviceFamily Name="Windows.Universal" MinVersion="10.0.15063.0" MaxVersionTested="10.0.17763.0" /&gt;
    &lt;/Dependencies&gt;
    &lt;Resources&gt;
      &lt;Resource Language="x-generate" /&gt;
    &lt;/Resources&gt;
    &lt;Applications&gt;
      &lt;Application Id="App" Executable="$targetnametoken$.exe" EntryPoint="Bluetooth_UWP.App"&gt;
        &lt;uap:VisualElements DisplayName="Bluetooth UWP App" Square150x150Logo="Assets\Square150x150Logo.png" Square44x44Logo="Assets\Square44x44Logo.png" Description="Bluetooth UWP Software" BackgroundColor="transparent"&gt;
          &lt;uap:SplashScreen Image="Assets\SplashScreen.png" BackgroundColor="#ffffff" /&gt;
          &lt;uap:InitialRotationPreference&gt;
            &lt;uap:Rotation Preference="landscape" /&gt;
            &lt;uap:Rotation Preference="landscapeFlipped" /&gt;
          &lt;/uap:InitialRotationPreference&gt;
        &lt;/uap:VisualElements&gt;
      &lt;/Application&gt;
    &lt;/Applications&gt;
    &lt;Capabilities&gt;
      &lt;Capability Name="internetClient" /&gt;
      &lt;!--&lt;DeviceCapability Name="serialcommunication"&gt;
        &lt;Device Id="any"&gt;
          &lt;Function Type="name:serialPort" /&gt;
        &lt;/Device&gt;
      &lt;/DeviceCapability&gt;
      &lt;DeviceCapability Name="bluetooth.genericAttributeProfile"&gt;
        &lt;Device Id="any"&gt;
          &lt;Function Type="name:genericAttribute" /&gt;
        &lt;/Device&gt;
      &lt;/DeviceCapability&gt;--&gt;
      &lt;DeviceCapability Name="bluetooth" /&gt;
    &lt;/Capabilities&gt;
  &lt;/Package&gt;
  </code></pre>
  
  <p>In the project properties, the minimum Windows version is set to 10.0.15063.
  It may be noticable that - after trying tp pack different variants of the project to solve the problem - I sometimes also get the "Payload contains two or more files" error. There seems to be a bunch of reasons. However, as a (maybe bit botched) workaround I change the Identity Name in the manifest and then it works. I decided to solve that problem later, but since it could also be related to the main problem I prefer to mention it here, too.
  In the past I used the nuget package "Win2D.uwp" for some visualization, but since I thought this could be a reason for one or both problems I excluded it from my code and project and deleted the nuget cache. Unfortunately, that didn't help, too...</p>
  
  <p>To make a long story short: If anyboby has an idea I would be very thankful. Maybe it is one of these "oh man, it seems you deleted <em>this</em> important statement" cases. Thank you for your help!</p>