Tag: visual studio cordova

在Windows Phone上启动pdf文件时出现System.Runtime.InteropServices.COMException

我正在尝试使用以前在其他应用上使用的以下工作代码打开pdf文件, 但是这次当流程命中这行时我得到System.Runtime.InteropServices.COMException:Windows.System.Launcher.LaunchFileAsync(pdffile); 这个例外是什么意思以及如何摆脱它? 请注意,如果不关心此exception(禁用它), 该文件仍然无法打开。 请注意:该文件存在于我的隔离文件夹中(使用wpowertool检查), 我尝试了2个不同的文件,所以它不应该是文件损坏的问题。 public void openFile(string options) { System.Diagnostics.Debug.WriteLine(“options: ” + options); string optVal = JsonHelper.Deserialize(options)[0]; asyncOpen(optVal); } public async Task asyncOpen(string filename) { filename = filename.Substring(2, filename.Length – 2); filename = filename.Replace(“//”, “/”).Replace(“/”, “\\”); Windows.Storage.StorageFolder local = Windows.Storage.ApplicationData.Current.LocalFolder; Debug.WriteLine(“local: ” + local.Path); Windows.Storage.StorageFile pdffile = await local.GetFileAsync(filename); Debug.WriteLine(“pdffile: ” + […]