我正在用两个设备交替地调试我的Xamarin.Android应用程序
在我的MainLauncher-活动中,用户直接被请求许可(照相机、RecordAudio、ReadExternalStorage、WriteExternalStorage等)。
在权限-检查之后,应用程序将一个新条目写入日志文件。到目前为止,所有设备都能正常工作(2019年9月10日)。
在我的华为法官席上,我获得了一个System.UnauthorizedAccessException:‘路径访问被拒绝’。

我不知道如何处理这个错误。
只有安卓9还能工作!
昨天,所有的设备都正常工作。
编辑:--我可以用这个线程https://github.com/xamarin/xamarin-android/issues/3426中提到的解决方法来解决这个问题
使用
var fileBytes = File.ReadAllBytes(tempfile);
File.WriteAllBytes(filePath, fileBytes);而不是
File.Copy(tempfile, filePath, true);发布于 2019-09-10 08:32:56
使用
var fileBytes = File.ReadAllBytes(tempfile);
File.WriteAllBytes(filePath, fileBytes);而不是
File.Copy(tempfile, filePath, true);是解决这个问题的方法。你可以在这里找到一个公开的讨论。
https://stackoverflow.com/questions/57866600
复制相似问题