在打开VS 2010之后,我创建了一个空的MVC 4 Web应用程序'UmbracoTest'以及一个新的解决方案。 View引擎是Razor和.Net 4.在Package Manager控制台中,我输入了PM> install-package umbracocms并提示:
PM> install-package umbracocms
Attempting to resolve dependency 'UmbracoCms.Core (= 7.5.4)'.
Attempting to resolve dependency 'Microsoft.AspNet.Mvc (≥ 5.2.3 && < 6.0.0)'.
Attempting to resolve dependency 'Microsoft.AspNet.Razor (≥ 3.2.3 && < 3.3.0)'.
...
...
Installing 'Microsoft.AspNet.Razor 3.2.3'.
Successfully installed 'Microsoft.AspNet.Razor 3.2.3'.
...
...
Removing 'Microsoft.AspNet.Razor 2.0.20710.0' from UmbracoTest.
Successfully removed 'Microsoft.AspNet.Razor 2.0.20710.0' from UmbracoTest.
Adding 'Microsoft.AspNet.Razor 3.2.3' to UmbracoTest.
Uninstalling 'Microsoft.AspNet.Razor 3.2.3'.
Successfully uninstalled 'Microsoft.AspNet.Razor 3.2.3'.
Install failed. Rolling back...
Install-Package : Could not install package 'Microsoft.AspNet.Razor 3.2.3'. You are trying to install this package into a project that targets '.NETFramewo
rk,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 <<<< umbracocms
+ CategoryInfo : NotSpecified: (:) [Install-Package], InvalidOperationException
+ FullyQualifiedErrorId : NuGetCmdletUnhandledException,NuGet.PowerShell.Commands.InstallPackageCommand
PM>
答案 0 :(得分:1)
如错误所示:You are trying to install this package into a project that targets '.NETFramework,Version=v4.0'
。 Umbraco依赖于ASP.NET MVC 5,它不适用于.NET 4.0。实际上,VS2010不支持.NET 4.5。相反,您将需要Visual Studio 2012或更高版本。
如果您是学生,开源开发人员或个人开发人员,则可以使用免费社区版download of Visual Studio。