安装Ninject时,我从VS2015的输出中获取此日志:
Attempting to gather dependencies information for package 'Ninject.3.2.2' with respect to project 'ProjectPhoenix.Droid', targeting 'MonoAndroid,Version=v5.1'
Attempting to resolve dependencies for package 'Ninject.3.2.2' with DependencyBehavior 'Lowest'
Resolving actions to install package 'Ninject.3.2.2'
Resolved actions to install package 'Ninject.3.2.2'
Attempting to gather dependencies information for package 'Ninject.3.2.2' with respect to project 'ProjectPhoenix.iOS', targeting 'Xamarin.iOS,Version=v1.0'
Attempting to resolve dependencies for package 'Ninject.3.2.2' with DependencyBehavior 'Lowest'
Resolving actions to install package 'Ninject.3.2.2'
Resolved actions to install package 'Ninject.3.2.2'
For adding package 'Ninject.3.2.2' to project 'ProjectPhoenix.Droid' that targets 'monoandroid51'.
Install failed. Rolling back...
Package 'Ninject 3.2.2.0' does not exist in project 'ProjectPhoenix.Droid'
Could not install package 'Ninject 3.2.2'. You are trying to install this package into a project that targets 'MonoAndroid,Version=v5.1', but the package does not contain any assembly references or content files that are compatible with that framework. For more information, contact the package author.
========== Finished ==========
我正在使用Xamarin,同样的项目在Xamarin Studio和Visual Studio 2015的其他实例上运行得很好,所以我知道这不是代码问题,而是我的配置问题。
答案 0 :(得分:3)
我相信你提出的问题在这个其他问题中得到了解答:
How come there's no IKernel implementation in Ninject.Portable
Ninject需要特定于平台的代码才能在每个Xamarin平台中运行,因此,对于Xamarin项目,我建议您使用Ninject.Portable NuGet包而不是普通的Ninject包。您还需要在Droid,iOS,Tests和UITests项目中安装NuGet,以便能够编译所有解决方案。
最好的问候