我在使用 Twitter Bootstrap 启动 MVC4 应用程序时遇到问题。
在 VS 2012 中,我创建了一个新的空 MVC4 应用程序,安装了以下包:
- 安装包 twitter.bootstrap.mvc4
- 安装包 twitter.bootstrap.mvc4.sample
似乎是一些与导航路线选项相关的问题,因为我正在经历这几个 turorials Link 1和 Link 2 .
在阅读有关可能的编译问题的说明时,我重新启动了解决方案,但我收到的错误不是自述文件中的错误,而是集中在 NavigationRouteOptions
、NavigationRouteFilters
、RouteValueDictionary
、FilterToken
和 HasFilterToken
:
'System.Web.Routing.RouteValueDictionary' does not contain a definition for 'HasFilterToken' and no extension method 'HasFilterToken' accepting a
first argument of type 'System.Web.Routing.RouteValueDictionary' could be found (are you missing a using directive or an assembly reference?)
...\AdministrationRouteFilter.cs 18
'System.Web.Routing.RouteValueDictionary' does not contain a definition for 'FilterToken' and no extension method 'FilterToken' accepting a
first argument of type 'System.Web.Routing.RouteValueDictionary' could be found (are you missing a using directive or an assembly reference?)
..\AdministrationRouteFilter.cs 20
The name 'NavigationRouteFilters' does not exist in the current context
'NavigationRouteOptions' could not be found (are you missing a using directive or an assembly reference?)
我已经确认我确实安装了 navigationroutes.mvc4
Nuget 包。
这只适用于 VS 2013 吗?
Nuget 包的日期是 2013 年 10 月 26 日。
感谢协助。
最佳答案
似乎已经有人讨论了 github 中的错误
尝试卸载 1.1.100 并按以下顺序安装 1.0.90 版本。
- PM> Install-Package twitter.bootstrap.mvc4.sample -Version 1.0.90
- PM> Uninstall-Package twitter.bootstrap.mvc4.htmlhelpers -Force
- PM> Install-Package twitter.bootstrap.mvc4.htmlhelpers -version 1.0.90
- PM> Uninstall-Package twitter.bootstrap.mvc4 -Force
- PM> Install-Package twitter.bootstrap.mvc4 -version 1.0.90
关于c# - 如何解决 VS2012 中简单的 Nuget 安装导致 MVC4 Twitter Bootstrap 项目失败的问题?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19618771/