I've been writing a few packages that sit in the background and do stuff while umbraco is running. there is a lot of posts about people overiding ApplicationBase to get things to run when Umbraco starts, but that's so 4.7.x. In 4.8/9/10 you are ment to use IApplicationEventHandler - which I am.
but now in Umbraco 6 i'm getting errors because IApplicationEventHandler has moved from Umbraco.Web to Umbraco.Core (i think?)
also
the functions now take UmbracoApplicationBase where previously it was UmbracoApplication
Is there something i can/should be doing to allow my dll's to work cross versions 4.11.x / 6.x+ or should i just have two copies one for 6 and one for 4.11.x ?
ideally if the functional calls are going to change then the Interface name should also ? if it was now IApplicationEventHandler2 then i could have a single DLL with two entry points ? but because the name is the same it throws a wobbler
Cross compatible IApplicationEventHandler 4.11 -> 6 ?
Hello,
I've been writing a few packages that sit in the background and do stuff while umbraco is running. there is a lot of posts about people overiding ApplicationBase to get things to run when Umbraco starts, but that's so 4.7.x. In 4.8/9/10 you are ment to use IApplicationEventHandler - which I am.
but now in Umbraco 6 i'm getting errors because IApplicationEventHandler has moved from Umbraco.Web to Umbraco.Core (i think?)
also
the functions now take UmbracoApplicationBase where previously it was UmbracoApplication
Is there something i can/should be doing to allow my dll's to work cross versions 4.11.x / 6.x+ or should i just have two copies one for 6 and one for 4.11.x ?
ideally if the functional calls are going to change then the Interface name should also ? if it was now IApplicationEventHandler2 then i could have a single DLL with two entry points ? but because the name is the same it throws a wobbler
i think i've answered my own question at the end there - i am now building the dll with duplicate functions so forexample
public void OnApplicationStarting(UmbracoApplicationBase httpApplication, ApplicationContext applicationContext)
and
public void OnApplicationStarting(UmbracoApplication httpApplication, ApplicationContext applicationContext)
OK scratch that (and tell me to stop talking to myself) as UmbracoApplicationBase doesn't exist in 4.11.x it doesn't work.
so back to first question, any cross compatible way of doing this between 4.11.x and 6.x+ ?
HI Kevin,
Use the good old ApplicationBase,I use this for all my packages and it will work for a while ;-) It will be converted to the prefered API per environment. Check my old blogpost hwo to use it http://www.richardsoeteman.net/PermaLink,guid,f470b6cf-40da-4aa9-a0d9-7b984fe9bf59.aspx
Cheers,
Richard
Yeah, ApplicationBase has been Deprecated for a while and i was trying to be a good boy : )
For now I've just put some preprocessor defines in for v4 and v6 - and i'm compiling two versions of the dll.
is working on a reply...