Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Glimpse loading twice because of MvcTurbine #13

Open
gligoran opened this issue Jul 12, 2011 · 14 comments
Open

Glimpse loading twice because of MvcTurbine #13

gligoran opened this issue Jul 12, 2011 · 14 comments
Assignees

Comments

@gligoran
Copy link

Hi!

I've run into a little trouble using MvcTurbine alongside Glimpse (http://getglimpse.com/). It seems that MvcTurbine picks it up and makes it load twice, one on top of the other. This is visible if you resize the top instance of glimpse and see the other one behind it. The top instance doesn't seem to work either. And also breaks the bottom one. I've tried it with a clean MVC 3 application and just the most basic MvcTurbine implementation and it confirmed that MvcTurbine is at fault. Also, here's a picture how it looks like: http://i.imgur.com/QRBCY.png. The glimpse instances go all the way to the bottom of the page, where Firebug starts. Firebug also shows the duplicate glimpse stuff.

How can I fix this? I saw that MvcTurbine has a class called AssemblyFilter, but I can figure out how or where to do an assembly to it from my MvcApplication.

Glimpse would probably be a good candidate for the CommonAssemblyFilter.

Thanks,
Goran

@jglozano
Copy link
Member

Hi @gligoran,

I haven't had time to play with Glimpse so I'm unaware of the symptom you're describing. When you say it "loads" twice, what's the component that's actually loading?

@darrencauthon
Copy link
Contributor

Javier, it sounds like Goran can make use of your new HttpModuleRegistry. This is just a guess (I haven't worked with Glimpse yet), but I'd bet Goran is setting up Glimpse the proper way, and then MVC Turbine comes in after-the-fact and loads it in again using conventions. Maybe?

@jglozano
Copy link
Member

@darrencauthon it could be. @gligoran you can use the following configuration to disable this piece - https://gist.github.com/1073711

@gligoran
Copy link
Author

It seems that Darren was right, because Javier's

Engine.Initialize.DisableHttpModuleRegistration();

line of code fixes the double Glimpse overlay.

Glimpse.Core now works fine, but there still seems to be a problem with Glimpse.Mvc3. Somewhere MvcTurbine and a component of Glimpse.Mvc3 get mixed and it creates an infinite loops which eventually throws a StackOverflowException.

I've tested by adding MvcTurbine projects from GitHub and it turns out that if I add Glimpse as a filter to the CommonAssemblyFilter it works find. So I guess MvcTurbine grabs something and wants to resolve dependencies in a loop. So how can I add an AssemblyFilter without having to make my own version of MvcTurbine?

@gligoran
Copy link
Author

OK, I've managed to get it working with this: https://gist.github.com/1078530

It does the job, but it seems like a very hackish workaround. Is there a better way to add an assembly filter?

@jglozano
Copy link
Member

Close actually. You can specify the AssemblyFilter for the application to use the same way you specified the AutoRegistrator. Here's your gist with my changes to register a GlimpseFilter - https://gist.github.com/1078700

@jglozano
Copy link
Member

Out of curiosity what IoC container are you using for your Turbine application?

@gligoran
Copy link
Author

At the moment I'm using Unity. I was using Ninject for previous projects, but then I saw Darren's benchmarking results and switched. I wanted to switch to StructureMap, but something was not working and I just took the next on the list. Darren hasn't yet put Hiro on NuGet at that time, but now I'm looking into it.

@jglozano
Copy link
Member

Cool, no problem. I ask so I can test the pieces with your IoC and see if I run into the same issues. At times it's hard to pin point when it's a "turbine issue" or a "environment (vs, container, etc.)" so I like to get as much insight as I can to provide the right support.

@gligoran
Copy link
Author

Cool. It looks like you really invest a lot of time and effort in MvcTurbine. That's probably why it's so great :)

On the other note, the gist you posted earlier doesn't seem to work. I get a load of errors that MvcTurbine couldn't load Glimpse assemlies.

MVC Turbine could not find & load the dependencies for assembly 'Glimpse.Elmah, Version=0.9.3.0, Culture=neutral, PublicKeyToken=null'

Dependencies that failed to load:
-----------------------------------

Method 'GetData' in type 'Glimpse.Elmah.Plugin.ElmahPlugin' from assembly 'Glimpse.Elmah, Version=0.9.3.0, Culture=neutral, PublicKeyToken=null' does not have an implementation.

-----------------------------------

Method 'ProcessRequest' in type 'Glimpse.Elmah.Responder.ElmahHandler' from assembly 'Glimpse.Elmah, Version=0.9.3.0, Culture=neutral, PublicKeyToken=null' does not have an implementation.

-----------------------------------

Method 'ProcessRequest' in type 'Glimpse.Elmah.Responder.ResourceHandler' from assembly 'Glimpse.Elmah, Version=0.9.3.0, Culture=neutral, PublicKeyToken=null' does not have an implementation.

-----------------------------------

Not really sure why it chose Elmah for Glimpse first, but if I remove that dependency it loops itself into the before mentioned StackOverflow exception which crashes the development server.

@jglozano
Copy link
Member

I'll have to take a look at that to see what's going on underneath the scenes. Is this private or public code that I may see?

@gligoran
Copy link
Author

At this time is private and actually just local on my machine. I'll try to reproduce the behaviour on a mvc 3 starter application and upload it to GitHub tomorrow (it's getting late in europe). I'm quite certain it won't be difficult as I've been testing for specific errors on those starter apps to see if maybe it's just a bug/discrepancy in my code somewhere, but until now I've been able to reproduce those errors. I'll post back once it's done.

@ghost ghost assigned jglozano Jul 13, 2011
@gligoran
Copy link
Author

OK, I've finally managed to put up a project that encompasses everything we talked about.
I've wanted to add Elmah for Glimpse, but it seems it conflicts with the new Glimpse.

You can find the project here: https://github.com/gligoran/GlimpseWithTurbine/

There's also a separate branch for when I include Glimpse.Mvc3, so you can investigate the HttpHandler and the AssemblyFilter/AutoRegistrator errors separately.

I've added you as a collaborator on the project if you feel like committing and better solutions.

@jglozano
Copy link
Member

thanks man! I'll look at it today and get back to you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants