mscorlib.ni.dll 中的 UWP App 'System.IO.FileNotFoundException' 启动时出现异常

UWP App 'System.IO.FileNotFoundException' in mscorlib.ni.dll Exception at startup

我有一个包含 UWP 项目的 Xamarin.Forms 解决方案。由于我的开发机器是 Windows 8.1,我在另一台安装了 Windows 10 的电脑上设置了远程调试,该电脑安装在我的同一局域网中。因此,在 Visual Studio 中,我必须右键单击我的 UWP 项目并选择 "Deploy" 确保选择 "Remote Machine"。之后我可以通过点击远程机器来调试。

成功了,应用程序使用这个远程调试没有问题。

由于此 UWP 没有自己的资产(徽标、图标等),我打开清单设计器以在“视觉资产”部分选择图像。编译,部署,并再次尝试远程调试。 现在该应用程序无法打开,并且出现以下异常:

AppConsume.UWP.exe' (CoreCLR: CoreCLR_UWP_Domain): Loaded 'C:\Users\Usuario\AppData\Local\DevelopmentFiles\f736c883-f105-4d30-a719-4bf328872f5eVS.Debug_x86.JOHN_SMITH\Xamarin.Forms.Platform.dll'. Cannot find or open the PDB file.
'AppConsume.UWP.exe' (CoreCLR: CoreCLR_UWP_Domain): Loaded 'C:\Users\Usuario\AppData\Local\DevelopmentFiles\f736c883-f105-4d30-a719-4bf328872f5eVS.Debug_x86.JOHN_SMITH\Xamarin.Forms.Xaml.dll'. Cannot find or open the PDB file.
Excepción producida: 'System.IO.FileNotFoundException' en mscorlib.ni.dll
Excepción producida: 'System.IO.FileNotFoundException' en mscorlib.ni.dll
Excepción producida: 'System.IO.FileNotFoundException' en mscorlib.ni.dll

我尝试了其他解决方案,例如删除此处所述的 Package Data 文件夹:,但没有成功。

有什么想法吗?

更新: 在断点设置中选中 System.IO.FileNotFoundException 后,我可以获得有关当前异常的更多信息。

在 App.xaml.cs 文件的 Xamarin.Forms.Forms.Init(e); 中抛出此异常:

Could not load file or assembly 'ClrCompression, Culture=neutral, PublicKeyToken=null' or one of its dependencies.

我也更新了 UWP 包到 5.2.2

编译和 运行 调试中的应用程序调整构建配置。

在 Visual Studio 2015 年,它在构建 > 配置管理器 window 中(默认情况下可能不会发生)。勾选通用项目的构建和部署框:

然而,我仍然在日志中得到一些 'System.IO.FileNotFoundException',但至少应用程序打开了。

https://developer.xamarin.com/guides/xamarin-forms/platform-features/windows/installation/universal/