Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
288 views
in Technique[技术] by (71.8m points)

c# - How to resolve MVC4 Twitter Bootstrap project fail from simple Nuget installations in VS2012?

I'm having an issue with launching a MVC4 application with the Twitter bootstrap.

In VS 2012, I created a new empty MVC4 application, installed the following packages:

  • Install-Package twitter.bootstrap.mvc4
  • Install-Package twitter.bootstrap.mvc4.sample

Seems like some navigation route options-related issues, as I am going through these few turorials Link 1 and Link 2.

In reading the note about possible compile issues, I restarted the solution, but errors I'm receiving aren't the ones in the readme and are focused around the NavigationRouteOptions, NavigationRouteFilters, RouteValueDictionary, FilterToken and 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?)

I have confirmed that I do have navigationroutes.mvc4 Nuget package installed as well.

Is this only working in VS 2013?

The Nuget packages are dated October 26, 2013.

Assistance appreciated.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

It seems there is already a discussion about the error in github

try uninstalling 1.1.100 and install 1.0.90 versions in the following order.

  • 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

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...