AutofacContrib.DynamicProxy2 NuGet包

时间:2012-11-07 16:21:05

标签: nuget autofac nuget-package

我在安装AutofactContrib.DynamicProxy2时遇到问题 在尝试获取AutofactContrib.DynamicProxy2 NuGet包时,出现以下错误:

  

PM>安装包AutofacContrib.DynamicProxy2
  试图解决依赖性'Autofac(≥2.4.5.724)'   试图解决依赖'Castle.Core(≥2.5.2)'   试图解决依赖关系'Castle.DynamicProxy(≥2.2.0)'   试图解决依赖'Castle.Core(= 1.2.0)'   安装包:将“Castle.Core 2.5.2”更新为“Castle.Core 1.2.0”失败。无法找到与'Castle.Core 1.2.0'兼容的'AutofacContrib.DynamicProxy2'版本。在行:1 char:16
  + install-package<<<< AutofacContrib.DynamicProxy2
      + CategoryInfo:NotSpecified:(:) [Install-Package],InvalidOperationException
      + FullyQualifiedErrorId:NuGetCmdletUnhandledException,NuGet.PowerShell.Commands.InstallPackageCommand

据我了解,在Castle V.3中,不再有DynamicProxy.dll,但它包含在Castle.Core.dll中。
我想我必须安装以前版本的Castle.Core.dll,但由于某种原因,该软件包依赖于'Castle.Core (≥ 2.5.2)',所以即使我手动安装Castle.Core V. 1.2,我仍然得到这个错误。
有人有解决方案吗?

1 个答案:

答案 0 :(得分:3)

尝试使用-ignoredependencies,它适用于targetFramework="net40"

PM> install-package autofaccontrib.dynamicproxy2 -ignoredependencies

您可以单独安装依赖项

Autofac(≥ 2.4.5.724)
Castle.Core(≥ 2.5.2)
Castle.DynamicProxy(≥ 2.2.0)

<强>结果

PM> install-package autofaccontrib.dynamicproxy2 -ignoredependencies
Successfully installed 'AutofacContrib.DynamicProxy2 2.4.5.724'.
Successfully added 'AutofacContrib.DynamicProxy2 2.4.5.724' to StackOverflow2.

PM>