xamarin - Ninject StandardKernel System.ArgumentNullException : value cannot be null. 参数名称:path1

标签 xamarin ninject

我是一个学习者Xamarin我想使用 Ninject对于 IoC容器和依赖注入(inject)。我添加了 Ninject 3.3.4使用 NuGet包裹在 Visual studio 2017社区。我在 App.Xaml.cs 中的以下代码行收到错误:

Kernel = new StandardKernel(new TripLogCoreModule(), new TripLogNavModule(mainPage.Navigation));

我收到以下错误:

Ninject StandardKernel System.ArgumentNullException: value cannot be null. Parameter name: path1



我在互联网上花了大约 2 个小时,找不到解决问题的方法。

最后,我发现了自己的疏忽,所以我想发布这个问题并回答我自己的问题,以防其他人(像我这样的新手)犯这个错误。

最佳答案

就我个人而言, 都有错误。忍者 Ninject.PCL

尝试构建 标准内核 忍者设置 :

var settings = new Ninject.NinjectSettings() { LoadExtensions = false };
Kernel = new StandardKernel(settings, new ViewModelsModule());

问候

关于xamarin - Ninject StandardKernel System.ArgumentNullException : value cannot be null. 参数名称:path1,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50583244/

相关文章:

java - 编译 Android 代码时出现 xamarin 错误。 java\lang\Object.class 主要版本 51 比 50 新,该编译器支持的最高主要版本

android - Android AXML 中的 MVVMCross MvxDatePicker 绑定(bind)

ios - Xamarin 统一 IOS WKWebView 崩溃

asp.net-mvc - 使用 Ninject 时如何处理 DBContext

c# - 不懂ninject和injecting

Android图片大小困惑

c# - 链接程序集意外失败 (Xamarin.ios.dll)

c# - 加载 Ninject 模块后设置所有绑定(bind)的范围

c# - 你如何制作一个通用的通用工厂?

asp.net-mvc - Ninject + ASP.NET MVC + InRequestScope