我有一个包含 UWP 项目的 Xamarin.Forms 解决方案。由于我的开发机器是 Windows 8.1,因此我在另一台 PC 上设置了远程调试,并在我的同一个 LAN 中安装了 Windows 10。因此,在 Visual Studio 中,我必须右键单击我的 UWP 项目并选择“部署”,确保选择“远程机器”。之后,我可以通过点击远程机器进行调试。
它有效,应用程序使用此远程调试没有问题。
由于这个 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 文件夹:Exception throw: 'System.Exception' in mscorlib.ni.dll on UWP App Start,但没有成功。
有任何想法吗?
更新:在断点设置中检查 System.IO.FileNotFoundException 后,我可以获得有关当前异常的更多信息。
从Xamarin.Forms.Forms.Init(e);
App.xaml.cs 文件中抛出此异常:
Could not load file or assembly 'ClrCompression, Culture=neutral, PublicKeyToken=null' or one of its dependencies.
我还将 UWP 包更新到 5.2.2