I added the config file from the hotfix zip file. I'm guessing that is the one it needs? Or is there a separate config file for the console app things?
What am I missing here? I'm not getting any exception, just no prviders...
Yes, config file is the same, no matter if it runs on web or console.
The LoadAssemblies method is used to load all the providers courier has, item providers and repository providers, so those dlls should be put in a seperate folder
Download the console app source on nightly to see how the initial wirering is done
Ok, that helped a bit. But I only get one provider from the collection: "Tag Relations". Shouldn't I be getting a few more? Or is it because I am not yet connecting to a webservice?
The idea is to loop through the providers one by one, and picking the items we want to transfer, and then create the package. Im' thinking I don't need the webservice until I start loping through the actual items using provider.AvailableSystemItems()? Or am I mistaken? :)
This piece of code, gives me a full list of item providers, you shouldn't need to connect to any source to get the providers
//To init our app, we need to load all provider dlls from our plugins dir //The application needs the DLL umbraco.courier.providers.dll to work with the build-in providers //you can add any dll in there to load your own Umbraco.Courier.Core.Helpers.TypeResolver.LoadAssembliesIntoAppDomain(plugins, "*.dll");
//we also need to tell it where to get it's config xml //this is the standard courier file which contains settings for the engines and providers Umbraco.Courier.Core.Context.Current.SettingsFilePath = Path.Combine(application, "courier.config");
//finally we need to redirect the revisions root for correct mapping Umbraco.Courier.Core.Context.Current.BaseDirectory = directory; Umbraco.Courier.Core.Context.Current.HasHttpContext = false;
foreach (var q in Umbraco.Courier.Core.ProviderModel.ItemProviderCollection.Instance.GetProviders()) { Console.WriteLine(q.Name); }
I noticed in one of the samples that there was a log.txt file in the bin folder, but I can't seem to find any info on it in the docs. Can I explicitly enable logging?
I think the next step is to try and connect to a local website, and see if I can get any connection/exceptions.
Creating Courier packages in a console app
I just downloaded the 2.5 hotfix version, and the sample console apps, and I am trying to create a console app to package up my items for me.
I started out witht the first sample in the manual: http://nightly.umbraco.org/UmbracoCourier/Developer%20Docs.pdf
The problem is, that it seems that I am not getting any providers what so ever. My code so far is:
Hi Morten
You need to load the dlls into the appdomain for courier to actually pick up on them, (not needed in a web application, but is in console apps)
Even if there is nothing in the plugins folder? (Which dll's would I need there?)
And a bit more detail :)
Yes, config file is the same, no matter if it runs on web or console.
The LoadAssemblies method is used to load all the providers courier has, item providers and repository providers, so those dlls should be put in a seperate folder
Download the console app source on nightly to see how the initial wirering is done
/per
umbraco.courier.providers and repositoryproviders.dll
Ok, that helped a bit. But I only get one provider from the collection: "Tag Relations". Shouldn't I be getting a few more? Or is it because I am not yet connecting to a webservice?
The idea is to loop through the providers one by one, and picking the items we want to transfer, and then create the package. Im' thinking I don't need the webservice until I start loping through the actual items using provider.AvailableSystemItems()? Or am I mistaken? :)
This piece of code, gives me a full list of item providers, you shouldn't need to connect to any source to get the providers
Hmm. I must be doing something wrong then :-)
Is it looking in the config for them, or is it pure reflection?
And this is 2.5 code right? Or is it for 2.1?
It's pure reflection, but it might look in the config file for settings required by each provider
tested on 2.5
Could it be a licensing thing?
I'm able to get some providers if I do this:
Do I need a license to write the cmd app, or is only when connection to an umbraco instance?
Hmm, I'm having no luck it seems.
I noticed in one of the samples that there was a log.txt file in the bin folder, but I can't seem to find any info on it in the docs. Can I explicitly enable logging?
I think the next step is to try and connect to a local website, and see if I can get any connection/exceptions.
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.