Search code examples
c#wpf.net-coremsix

MSIX not packaging all dependencies


I've been looking into packing my WPF .Net Core 3.1 application into an MSIX installer using the packaging project.

However upon debugging or testing the output manually, the app crashes at launch due to it missing the Microsoft.EntityFrameworkCore.Design dll that my app is depending on. I can't quite understand why this is happening.

I do not reference this package directly, just the Microsoft.EntityFrameworkCore.Sqlite and Microsoft.EntityFrameworkCore.Tools packages, but when i do try to reference it directly, the behavior doesn't change.

I tried to follow this guide to setting it up for reference: https://learn.microsoft.com/en-us/windows/apps/desktop/modernize/modernize-wpf-tutorial-5

I can see the dll is absent from the folder, is there something extra I need to do on top of this guide to get my app to run? The dll is provided in the build directory for the app itself, just not in the build directory for the package.

Any suggestions would be really helpful


Solution

  • So after fiddling with settings I discovered that the Microsoft.EntityFrameworkCore.Tools package which was referencing the Microsoft.EntityFrameworkCore.Design package that was missing had some properties blocking it from being included in the package projects output.

    When pressing F4 on the EFC.Tools reference I found that its Private assets property was set to "all". Looking at the the documentation for this I can see that it would prevent the dll from passing to the package project where it would be needed.

    Removing this attribute appears to have fixed everything. Considering though that it was a default setting, it would be helpful to know if this was the right solution however, feels more like a workaround to me.