xamarin.android - Xamarin Android 应用程序中的 Autofac 错误
问题描述
我在 Xamarin 项目中使用 Autofac 来构建移动应用程序。在 Xamarin Live Player 1.5.176 (676) 中构建 Autofac 容器时出现以下错误(在华为 P20 上,最后一个安全补丁):
[LogEntry:时间=01/07/2018 11:00:08 +02:00,级别=错误,标题=可视化错误,消息=方法 System.Collections.Generic.IEnumerable
1<Autofac.Core.IComponentRegistration> Autofac.Core.IRegistrationSource::RegistrationsFor(Autofac.Core.Service,System.Func
2>) 上没有正文 (NInterpretException)]
我提出了重现该问题的解决方案:https ://github.com/EhRom/XamarinAutofac/
// Initialiaze container builder.
var containerBuilder = new ContainerBuilder();
containerBuilder.RegisterType<SampleViewModel>().As<ISampleViewModel>();
// Build container.
container = containerBuilder.Build();
错误发生在 Build() 方法上。我尝试添加选项,但没有成功。
你有没有遇到过这个问题?我该如何解决这个问题?
该错误不会在本地模拟器上重现(没有 Xamarin Live Player)。
解决方案
问题来自 Xamarin Live Player。
我直接在我的手机上部署了 apk 并且工作正常。
推荐阅读
- javascript - 如何将数字日期转换为字符串
- r - 仅在 ggplot2 图中显示 x 和 y 轴标签的最大和最小日期/值
- powershell - Powershell 自动化脚本更新 AD 错误,无法识别搜索过滤器
- javascript - 是否可以根据 VSCode 上的文件类型自动选择调试器?
- node.js - Nest JS 中间件 .exclude 选项不会阻止排除路由的中间件
- reactjs - react(或者一般来说可能是es6)是否允许别名导出?
- java - Pi4J 类路径错误 - Intellij 在 Pi 零 W 上远程运行
- java - 如何查找 Android Studio 2020.3.1 的 Firebase UI 依赖项
- java - SonarQube 抛出“用固定值替换随机生成的值”。测试方法
- php - Laravel 8 - 在 null 上调用成员函数 getRealPath()