首页 > 解决方案 > 如何在不获取路径空异常的情况下获取 Microsoft.Extensions.PlatformAbstractions.PlatformServices.Default

问题描述

我正在尝试将 Firestore 与 Xamarin 跨平台项目一起使用。创建 FirestoreDb 实例时,会引发 ArgumentNullException -> 值不能为空。从查看堆栈跟踪和消息来看,从 Microsoft.Extensions.PlatformAbstractions.ApplicationEnvironment.GetApplicationBasePath() 返回的路径为空。有谁知道我可以做些什么来让它不返回null?这只发生在Android项目上,在iOC上运行代码

标签: xamarin

解决方案


推荐阅读