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

查看:73
本文介绍了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生成的基本项目模板,因此这肯定是Microsoft的错误.我该如何解决他们的错误?

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:\Users\david\Dropbox\Projects\Visual Studio\PriceWatch\PriceWatch\PriceWatchXamarinForms\PriceWatchXamarinForms

(这个肿的结构是由IDE生成的,位于Visual Studio文件夹之后的所有内容)

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

我将其更改为 C:\ Projects \ PriceWatch \ PriceWatchXamarinForms ,然后它起作用了.

I changed it to C:\Projects\PriceWatch\PriceWatchXamarinForms and then it worked.

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

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