c# - 在 iOS 13 中访问(File.Copy)共享文件失败

标签 c# ios xamarin ios13

我正在使用该方法

File.Copy(url.Path, localAppDataPathWithFile)

在类AppDelegate.cs中的方法OpenUrl中(我使用Xamarin进行开发)。 这在 iOS 12 及更低版本中工作,不幸的是在 iOS 13 中我遇到了以下异常:

System.IO.FileNotFoundException: /private/var/mobile/Library/Mobile Documents/com~apple~CloudDocs/Downloads/catalog.zip does not exist

当我之前检查文件是否存在( File.Exists(url.Path) )时,我得到了 true。

有谁知道如何解决这个问题或者 iOS 13 发生了什么变化?

最佳答案

我可以通过将 info.plist 键“LSSupportsOpeningDocumentsInPlace”从 true 设置为 false 来解决该问题。

关于c# - 在 iOS 13 中访问(File.Copy)共享文件失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58408239/

相关文章:

c# - Linq to objects 列表中的列表

c# - 从资源C#播放音乐

ios - 使用 Kingfisher 的 Swift iOS 照片采集会导致内存增长

ios - 如何在 Cordova iOS 应用程序中播放 html 5 视频?

ios - UIImage 可拉伸(stretch)图像以生成类似消息气泡的结果

c# - 从 C# 调用包含指针的 Delphi DLL 结构不起作用

c# - ASP.NET 核心 : Error when using a custom DbContext while also using Identity

ios - 如何在 Macbook 中的 iPhone 6s 模拟器上找到 SQLite 数据库?

.net - 为 .NET Core/UWP 中的单个 HTTP 请求设置自定义 WebProxy

macos - 如何从命令行在 Visual Studio 中构建 Xamarin DLL?