更新时间:2023-02-11 18:49:23
看来你安装的NuGet需要剃刀2.0里面自带ASP.NET MVC 4.0。 ASP.NET MVC 3使用剃刀1.0。所以一定要安装一个版本的 PagedList.Mvc
的NuGet是与ASP.NET MVC 3.0兼容的。例如,你可以使用 3.18.0.0
版本,这是用剃刀1.0。
It seems that the NuGet you installed requires Razor 2.0 which comes with ASP.NET MVC 4.0. ASP.NET MVC 3 uses Razor 1.0. So make sure you install a version of the PagedList.Mvc
NuGet that is compatible with ASP.NET MVC 3.0. For example you could use the 3.18.0.0
version which is compatible with Razor 1.0.
要强制特定版本要安装一个给定的NuGet,而不是使用,你可以在你的NuGet控制台键入以下命令最新一期的:
To force a specific version to be installed for a given Nuget instead of using the latest one you could type the following command in your NuGet console:
Install-Package PagedList.Mvc -Version 3.18.0.0