1

我試圖安裝StructureMap.MVC4的一個項目,在Visual Studio 2012,.NET 4.0中創建和ASP.MVC 4.無法在.NET 4中,MVC 4安裝StructureMap.MVC4,VS 2012

但我越來越低於錯誤:

Could not install package 'Microsoft.AspNet.WebApi.Client 5.1.2'. You are trying to install this package into a project that targets '.NETFramework,Version=v4.0', 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:16 + install-package <<<< structuremap.mvc4 WebApi_StructureMap_DotNet4 + CategoryInfo : NotSpecified: (:) [Install-Package], InvalidOperationException + FullyQualifiedErrorId : NuGetCmdletUnhandledException,NuGet.PowerShell.Commands.InstallPackageCommand

任何建議,我什麼都不知道請!

回答

1

Microsoft.AspNet.WebApi.Client 5.1.2只能安裝到以.NET 4.5爲目標的項目中,或者是可移植的類庫。它沒有.NET 4.0的任何程序集。

最新版本的StructureMap 3.0取決於Microsoft.AspNet.WebApi.Client 5.1.2所以如果你想要的是最新版本的StructureMap 3.0,你需要改變你的項目,因此它的目標是.NET 4.5。

舊版本的StructureMap.MVC4可能適用於.NET 4.0。例如,版本2.6.4.3取決於支持.NET 4.0的舊版Microsoft.AspNet.WebApi。即使是舊版本的StructureMap.MVC4,如2.2.0也不依賴於Microsoft.AspNet.WebApi。

+0

謝謝馬特。這解決了這個問題。 –

相關問題