xamarin - 如何在不获取路径空异常的情况下获取 Microsoft.Extensions.PlatformAbstractions.PlatformServices.Default
问题描述
我正在尝试将 Firestore 与 Xamarin 跨平台项目一起使用。创建 FirestoreDb 实例时,会引发 ArgumentNullException -> 值不能为空。从查看堆栈跟踪和消息来看,从 Microsoft.Extensions.PlatformAbstractions.ApplicationEnvironment.GetApplicationBasePath() 返回的路径为空。有谁知道我可以做些什么来让它不返回null?这只发生在Android项目上,在iOC上运行代码
解决方案
推荐阅读
- php - PHP函数对CSS样式列表进行排序并将它们分组排列
- visual-studio-2017 - Visual Studio 2017 的属性中缺少构建类别
- c# - 连接到刚体时获取统一对撞机的游戏对象
- ecmascript-6 - “SyntaxError: Unexpected token export” 使用 Jest 和 babel 7+
- ruby - 没有将字符串隐式转换为整数,简单的 ruby 函数不起作用
- authentication - .NET Core 2.2 JWT 令牌授权失败未返回 HTTP 401
- html - 如何使用 CSS 网格对齐嵌套 HTML 中的列
- html - 如何使 div 高度始终与其宽度成比例(没有黑客)?
- dart - 如何@Input 一个复杂对象到我的 AngularDart 组件中?
- c# - 从声明中检查 ABP 权限