-
Notifications
You must be signed in to change notification settings - Fork 50
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
Mono Support #15
Mono Support #15
Conversation
if (_isRunningMono) | ||
{ | ||
HttpModuleActionCollection modules = (WebConfigurationManager.GetWebApplicationSection("system.web/httpModules") as HttpModulesSection).Modules; | ||
modules.Add(new HttpModuleAction(startMethodType.FullName, startMethodType.AssemblyQualifiedName)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't know you could do this. Does this work in .NET as well, or only Mono?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did not check because I assumed it'd be safer to stick with what was there.
I peeked inside and it seems that DynamicModuleUtility.RegisterModule() then simply invokes System.Web.HttpApplication.RegisterModule(), another method not implemented in Mono.
I'm not sure what the base implementation in HttpApplication is but whatever it is, it currently works in .NET. Best to stick with that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep, I was just curious. BTW, the reason I'm calling DynamicModuleUtility.RegisterModule()
instead of HttpApplication.RegisterModule()
is that the former existed in earlier versions of the framework (4.0 vs 4.5 I think), so it gives great compat.
Totally right, my problem was that I was attempting to compile in Mono so thus the reflection. |
I see. Ok, I'll try to make that change on my end in the next couple days. |
Oh, I just realized you did it already! I'll find the time to do basic verification and get that in soon. Thanks! |
Ok, change is in, and pushed to NuGet as version 2.0.4. Thanks for your contribution! |
Awesome, glad to have helped! |
It's not pretty...
Two things that are incompatible with Mono:
Both are worked around without changing the way the code runs when not on Mono (outside of a few extra conditions).