Reputation: 340
I installed Twitter.Bootstrap.mvc4 in a VS2010 project. I also installed Glimpse.
I found that the Menus using Navigation Routes that the Twitter.Bootstrap.mvc4 offers is "broken" by Glimpse. In the NavigationExensions.cs file, the RouteCollection is wrapped in Castle proxies causing the variable navigationRoutes to always return 0.
public static IEnumerable<NamedRoute> GetRoutesForCurrentRequest(RouteCollection routes,IEnumerable<INavigationRouteFilter> routeFilters)
{
var navigationRoutes = routes.OfType<NamedRoute>().Where(r=>r.IsChild==false).ToList();
I can see the information in the watch window and even get the information to show in the Immediate window using "((Castle.Proxies.RouteProxy_1)routes[5]).__target". So I thought to loop through the routes and looked for a named route. However, I don't know what to do to get the references I need to access the proxies. The Castle code is buried in the Glimpse.Core library.
I uninstalled Glimpse to make sure that was causing the problem (it is).
Upvotes: 5
Views: 756
Reputation: 6114
There is currently an issue which reflects the same problem, albeit in a different context.
There is currently no real fix, since GetRoutesForCurrentRequest
checks for NamedRoute
instances and Glimpse uses proxies, but you can always disable a part of Glimpse so that the navigation issue is fixed in the meanwhile.
To make it work again, you
RouteInspector
of GlimpseThis can be done in the configuration section of Glimpse
<glimpse defaultRuntimePolicy="On" endpointBaseUri="~/Glimpse.axd">
<inspectors>
<ignoredTypes>
<add type="Glimpse.AspNet.Inspector.RoutesInspector, Glimpse.AspNet"/>
</ignoredTypes>
</inspectors>
<tabs>
<ignoredTypes>
<add type="Glimpse.AspNet.Tab.Routes, Glimpse.AspNet"/>
</ignoredTypes>
</tabs>
</glimpse>
Upvotes: 5