Xamarin.Forms System.ArgumentException:路径中有非法字符 [英] Xamarin.Forms System.ArgumentException: Illegal characters in path

查看:22
本文介绍了Xamarin.Forms System.ArgumentException:路径中有非法字符的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是 Xamarin.Forms 项目的新手.我用 VS2019 创建了一个项目,该项目没有进行任何修改,在 Android 设备管理器中添加了一个 Pixel 2 Pie 9.0 - Api 28 模拟器.当我尝试在 android 模拟器上运行该项目时,我无法运行我的应用程序,在我的错误列表中出现以下异常:

I am brand new to Xamarin.Forms projects. I have created a project with VS2019 which has not been modified in any way, added a Pixel 2 Pie 9.0 - Api 28 emulator within the Android Device Manager. When I try to run the project on the android emulator, I am unable to run my app, with the following exception in my error list:

Error       XARDF7004: System.ArgumentException: Illegal characters in path.
   at System.Security.Permissions.FileIOPermission.EmulateFileIOPermissionChecks(String fullPath)
   at System.Security.Permissions.FileIOPermission.QuickDemand(FileIOPermissionAccess access, String fullPath, Boolean checkForDuplicates, Boolean needFullPath)
   at System.IO.Directory.Delete(String fullPath, String userPath, Boolean recursive, Boolean checkHost)
   at Xamarin.Android.Tasks.RemoveDirFixed.RunTask()
   at Xamarin.Android.Tasks.AndroidTask.Execute()   

由于我只是使用VS2019生成的基础项目模板,所以这肯定是微软端的一个bug.我该如何修复他们的错误?

Since I am simply using a basic project template generated by VS2019, this has to be a bug on Microsofts end. How can I fix their error?

推荐答案

这与我的解决方案文件夹的字符长度有关.

It had to do with the character length of my solutions folder.

C:UsersdavidDropboxProjectsVisual StudioPriceWatchPriceWatchPriceWatchXamarinFormsPriceWatchXamarinForms

(这个臃肿的结构是IDE生成的,Visual Studio文件夹后面的所有东西)

(This bloated structure was generated by the IDE, everything after the Visual Studio folder)

我将其更改为 C:ProjectsPriceWatchPriceWatchXamarinForms 然后它就起作用了.

I changed it to C:ProjectsPriceWatchPriceWatchXamarinForms and then it worked.

这篇关于Xamarin.Forms System.ArgumentException:路径中有非法字符的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆