title: How can you create an .msix package in WPF with .NET 5.0.0 when Microsoft.EntityFrameworkCore.SqlServer (5.0.0) is present (app won't launch)
body: <p>I have found that I can create a WPF app that deploys from an .msix package <strong>but won't launch</strong> if it contains Microsoft.EntityFrameworkCore.SqlServer package. Here is a repro (and some other quirks):</p>
  <p>Create WPF App .NET 5 app with Windows Application Packaging Project. Compiles and runs. Installs (side loaded) and launches.</p>
  <p>Cannot add Microsoft.EntityFrameworkCore (or SQLServer or Tools) 5.0.0 to the above Solution from the package manager. Get the following: Could not install package 'Microsoft.EntityFrameworkCore 5.0.0'. You are trying to install this package into a project that targets 'UAP,Version=v10.0.17763', but the package does not contain any assembly references or content files that are compatible with that framework.</p>
  <p>Can add all the EF packages (Microsoft.EntityFrameworkCore, Microsoft.EntityFrameworkCore.SqlServer and the Microsoft.EntityFrameworkCore.Tools)  if you first delete the WAPP project. Compiles and runs.</p>
  <p>Now able to add WAPP to a project that already has the EF packages and create an .msix. Side Load, with code signing certificate. Installs without visible errors. <strong>Does not launch</strong>. Icon is installed on Start Menu.</p>
  <p>If you remove the “all” value from the Private Assets property in Microsoft.EntityFrameworkCore.Tools (this fix worked in Core 3.1) and rebuild the app and WAPP, the .msix installs without visible errors. <strong>Does not launch</strong>. Icon is installed on Start Menu.</p>
  <p>If you remove the .Tools package and recreate the app, it compiles and runs, the WAPP can be recreated, the .msix installs but the app <strong>doesn’t launch</strong>.</p>
  <p><strong>If you remove the .SQLServer package and recreate the app, it compiles and runs, the WAPP can be recreated, the .msix installs but the app launches.</strong></p>
  <p>If you remove the WAPP package, add back the .Tools (so now the Microsoft.EntityFrameworkCore and the Microsoft.EntityFrameworkCore.Tools) and then recreate the WAPP the .msix is created, installs and the app launches.</p>
  <p>If you now add back Microsoft.EntityFrameworkCore.SqlServer version 3.1.10 it compiles and runs, the WAPP creates an .msix and the app installs and launches. However, you can’t scaffold  or execute without runtime errors with the .SqlServer 3.1.1 and EntitityFrameworkCore 5.0.0 together.</p>
  <p>So, it seems that there is something about the Microsoft.EntityFrameworkCore.SqlServer package that prevents the installed app from launching.</p>