简体   繁体   English

MSIX 未打包所有依赖项

[英]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.我一直在考虑使用打包项目将我的 WPF.Net Core 3.1 应用程序打包到 MSIX 安装程序中。

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.但是,在手动调试或测试 output 时,应用程序在启动时崩溃,因为它缺少我的应用程序所依赖的 Microsoft.EntityFrameworkCore.Design dll。 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.我没有直接引用这个 package,只是 Microsoft.EntityFrameworkCore.Sqlite 和 Microsoft.EntityFrameworkCore.Tools 包,但是当我尝试直接引用它时,行为不会改变。

I tried to follow this guide to setting it up for reference: https://docs.microsoft.com/en-us/windows/apps/desktop/modernize/modernize-wpf-tutorial-5我尝试按照本指南进行设置以供参考: https://docs.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?我可以看到文件夹中没有 dll,我需要在本指南之上做些什么才能让我的应用程序运行吗? The dll is provided in the build directory for the app itself, just not in the build directory for the package. dll 在应用程序本身的构建目录中提供,而不是在 package 的构建目录中。

Any suggestions would be really helpful任何建议都会非常有帮助

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. 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".在 EFC.Tools 参考上按 F4 时,我发现它的Private assets属性设置为“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.查看此文档,我可以看到它会阻止 dll 传递到需要它的 package 项目。

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.考虑到虽然这是一个默认设置,但知道这是否是正确的解决方案会很有帮助,但对我来说感觉更像是一种解决方法。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM