温莎城堡Xamarin PCL [英] Castle Windsor Xamarin PCL

查看:97
本文介绍了温莎城堡Xamarin PCL的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图将Castle.Windsor包含在Xamarin 3.0项目中,并将在该项目中使用可移植类库。当我尝试通过nuget包含它时,出现以下错误

I'm attempting to include Castle.Windsor in a Xamarin 3.0 project and a Portable class library that will be used in the project. When I attempt to include this via nuget, I get the following error

PM> install-package castle.Windsor
Attempting to resolve dependency 'Castle.Core (≥ 3.3.0)'.
Installing 'Castle.Core 3.3.0'.
Successfully installed 'Castle.Core 3.3.0'.
Installing 'Castle.Windsor 3.3.0'.
Successfully installed 'Castle.Windsor 3.3.0'.
Adding 'Castle.Core 3.3.0' to FuelCog.Core.CompositionRoot.
Uninstalling 'Castle.Core 3.3.0'.
Successfully uninstalled 'Castle.Core 3.3.0'.
Install failed. Rolling back...
install-package : Could not install package 'Castle.Core 3.3.0'. You are trying to install this package into a project that targets 'portable-net45+sl50+win+wp80+MonoAndroid10+MonoTouch10', 
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.
At line:1 char:1
+ install-package castle.Windsor
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Install-Package], InvalidOperationException
    + FullyQualifiedErrorId : NuGetCmdletUnhandledException,NuGet.PowerShell.Commands.InstallPackageCommand

我的目标是Xamarin.Android,Xamarin.iOS和Windows Phone 8.0。根据 SO答案,Castle.Windsor使用Mono框架。我尝试在PCL属性中禁用各种目标,以查看哪个目标不允许Castle.Windsor正确安装,但似乎没有一个可行的选择。

I'm targeting Xamarin.Android, Xamarin.iOS, and Windows Phone 8.0. According to this SO answer, Castle.Windsor works with the Mono framework. I've tried to disable various targets in the PCL properties to see which target was not allowing Castle.Windsor to install properly but it doesn't appear that there is a selection that works.

Castle.Windsor是否不能与PCL一起使用,或者我缺少某些东西?

Does Castle.Windsor not work with PCLs or am I missing something?

推荐答案

Windsor与PCL不兼容。 PCL配置文件中缺少API,例如。反射。

Windsor is not PCL compatible. There are missing APIs in PCL profile eg. Reflection.

这篇关于温莎城堡Xamarin PCL的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆