2012-11-07 72 views
1

我在安裝AutofactContrib.DynamicProxy2時遇到問題。
當試圖讓AutofactContrib.DynamicProxy2 NuGet包,我得到以下錯誤:AutofacContrib.DynamicProxy2 NuGet包

PM> install-package AutofacContrib.DynamicProxy2
Attempting to resolve dependency 'Autofac (≥ 2.4.5.724)'.
Attempting to resolve dependency 'Castle.Core (≥ 2.5.2)'.
Attempting to resolve dependency 'Castle.DynamicProxy (≥ 2.2.0)'.
Attempting to resolve dependency 'Castle.Core (= 1.2.0)'.
Install-Package : Updating 'Castle.Core 2.5.2' to 'Castle.Core 1.2.0' failed. Unable to find a version of 'AutofacContrib.DynamicProxy2' that is compatible with 'Castle.Core 1.2.0'. At line:1 char:16
+ install-package <<<< AutofacContrib.DynamicProxy2
+ CategoryInfo : NotSpecified: (:) [Install-Package], InvalidOperationException
+ FullyQualifiedErrorId : NuGetCmdletUnhandledException,NuGet.PowerShell.Commands.InstallPackageCommand

據我瞭解,在城堡V.3不再有一個DynamicProxy.dll,但它包含在Castle.Core.dll
我想我必須安裝以前版本的Castle.Core.dll,但由於某種原因該軟件包依賴於'Castle.Core (≥ 2.5.2)',所以即使我手動安裝Castle.Core V. 1.2,我仍然會收到此錯誤。
任何人都有這個解決方案?

回答

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> 
+0

同樣的錯誤。我想知道這個依賴來自哪裏 - Castle.Core(= 1.2.0)... –

+0

幾乎 - 與Castle.DynamicProxy的依賴關係也有一些不一致,所以我最終安裝了一切('autofaccontrib.dynamicproxy2', 'Castle.Core','Castle.DynamicProxy')和'ignoredependencies'標誌 –