我在使用Twitter引导启动MVC4应用程序时遇到了问题。如何解决MVC4 Twitter Bootstrap项目在VS2012中的简单Nuget安装失败?
在VS 2012年,我创建了一个新的空MVC4应用程序,安装以下软件包:
- 安装,包装twitter.bootstrap.mvc4
- 安装,包装twitter.bootstrap.mvc4.sample
看起来像一些导航路线选项相关的问题,因为我正在经历这些少数几个地区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包的日期为10月26日,2013年
援助表示赞赏。
这是11月19日,我有与VS2012中的NuGet安装包同样的问题。当我应用Muthu提供的修复程序时,由于Application_Start()中的重复调用到RegisterRoutes(),导致运行时错误。我很惊讶这个问题还没有得到解决...... – Sephrial
因此,将Nuget软件包应用于项目始终存在危险 - 您并不总是知道它们作为依赖项添加的内容,只是添加它们并不能你有一个关于它们如何连接的好主意.Bootstrap只是一个UI模板。我应用了自己的模板,并将它连接到自己......没有捷径。 – ElHaix
顺序安装/卸载将工作如下 PM>安装,包装twitter.bootstrap.mvc4 - 版本1.0.90 PM>安装,包装twitter.bootstrap.mvc4.htmlhelpers - 版本1.0.90 PM>安装-Package twitter.bootstrap.mvc4.sample -Version 1.0.90 –