When using Glimpse.AspNet 1.2.2 from nuget
Unable to cast object of type 'Castle.Proxies.RouteBaseProxy' to type 'Microsoft.AspNet.FriendlyUrls.FriendlyUrlRoute'.
Occurs after installing Glimpse.
Steps to reproduce.
1. Create Web Forms Applications
2. Install Glimpse.AspNet 1.2.2 using nuget package manager
3. Run application, error occurs.
Thanks for this report @jsonmez.
Did you install a special package for FriendlyUrl's? Is that package built into the WebForms project template now?
I didn't install a special package, so I am assuming it must be built into the default template.
Same issue here
Same issue here. If I comment out this section.
<!-- If you are having issues with Glimpse, please include this. It will help us figure out whats going on.
The error goes away. However Glimpse does not work, No Icon appears.
Wow ok. Next step if you are able to help out a little more is to try and debug with SymbolSource. This should tell us what the core exception is that you are getting. I must be happening pretty early on for logging to fail as well. Thanks for your continued help!
Well, I hate to say this, but after a bit of digging it looks like FriendlyUrl's has been implemented in a way to make it fundamentally incompatible with Glimpse. Of course, this problem is exacerbated now that Microsoft.AspNet.FriendlyUrls is included out of the box in the WebForms template.
The line in question is found in Microsoft.AspNet.FriendlyUrls.FriendlyUrlsModule.Init() (which is both internal and sealed):
FriendlyUrlRoute local_0 = (FriendlyUrlRoute) RouteTable.Routes["AspNet.FriendlyUrls"];
I'm not sure why the cast to FriendlyUrlRoute. The only place local_0 (as named by decompiler) is used is on the next line, which accepts an IFriendlyUrlRoute:
FriendlyUrlsModule.RedirectToFriendlyUrl((HttpContextBase) new HttpContextWrapper(((HttpApplication) sender).Context), (IFriendlyUrlRoute) local_0, Dependencies.VirtualPathUtility);
Either way, FriendlyUrlRoute is sealed as well as internal. (IFriendlyUrlRoute is also internal.)
If the implementation could be changed so that local_0 is cast to the interface instead, and that interface was made public, then we could do something in Glimpse to make this all work together.
I've reached out to @DamianEdwards and @GrabYourPitchforks who @shanselman says are the authors of the library to see if FriendlyUrl's is open source. Fingers crossed that it is and that they will accept a pull request.
UPDATE: I've heard back from @DamianEdwards. FriendlyUrls is not open source but he hopes it will be one day.
I have the same problem. I disable the routes tab and inspector as a temporary workaround.
<add type="Glimpse.AspNet.Tab.Routes, Glimpse.AspNet" />
<add type="Glimpse.AspNet.Inspector.RoutesInspector, Glimpse.AspNet" />
The above is the correct temp workaround. We are looking to bake a fix Ito glimpse that will just ignore these routes. It's not the best fix but it means it won't break.
Ok the temp workaround for this is as follows: if we detect that you are using any friendly URLs we will prevent the proxy process from getting involved and return a friendly error message which states why you aren't seeing anything. In the mean time, we are working with MS to see what can be done in the future.
Ok I have some good news. As of 1.0.2 of FriendlyUrls this issue will be fixed. Please see that update when it comes out.
Not a problem :)
Closing this off as it should be fixed with the current release of FriendlyUrls.
Really glad to hear!
I just got the same error and upgrading friendly URLs fixed it for me too. Thanks so much!
On 10-3-13 I just installed glimpse into a brand new default asp.net web application project using nuget and ran it with the same result. Using Visual Studio 2012.
@Wzack make sure you update the Microsoft.AspNet.FriendlyUrls NuGet package, the default VS template still contains an older version which is incompatible with Glimpse.