Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.0k views
in Technique[技术] by (71.8m points)

android - Xamarin.Forms System.ArgumentException: Illegal characters in path

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()   

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?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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

C:UsersdavidDropboxProjectsVisual StudioPriceWatchPriceWatchPriceWatchXamarinFormsPriceWatchXamarinForms

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

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


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...