I'm trying to do some simple packaging using the courier command line (on umbraco 4.11.4 with Courier_2.7.3_2.7.3.39) using the following:
private static void Main(string[] args)
{
var baseDirectory = AppDomain.CurrentDomain.BaseDirectory;
TypeResolver.LoadAssembliesIntoAppDomain(Path.Combine(baseDirectory, "Plugins"), "*.dll");
Context.Current.SettingsFilePath = Path.Combine(baseDirectory, @"Config\courier.config");
// This is the directory where revisions are located.
Context.Current.BaseDirectory = @"C:\Temp\Courier\Revisions";
Context.Current.HasHttpContext = false;
var repositoryStorage = new RepositoryStorage();
var source = repositoryStorage.GetByAlias("Source");
repositoryStorage.Dispose();
var engine = new RevisionPackaging("TestRevision") {Source = source};
engine.AddAllProvidersToQueue(true);
engine.Package();
}
I have a simple courier.config, with the only items of significance being my repository:
Hmm, you should remove the Umbraco.Courier.Persistence.V4.dll as that is not near to being done yet.
the issue is that you are trying to use the Nhibernate datalayer, but you need all the nhibernate dependencies in place, have a look in the standard courier zip hotfix for all the dependencies that courier needs to work with the nhibernate provider.
Also, are you absolutely sure that it finds the config file, and connects properly to the repository, because if you connect to a remore repository, it shouldnt need any local persistence layer, as that is all handled on the server, not in the client.
It is definitely finding my config file and connecting to it as I can see all the items when they have been added to the queue before trying to package.
I have the following files in my solution which I have taken from a version of the console app that you provided me with quite some time ago.
In my plugins folder i have the following:
Umbraco.Courier.DataResolvers.dll
Umbraco.Courier.Providers.dll
Umbraco.Courier.RepositoryProviders.dll
Umbraco.Courier.uComponents.dll
In my bin/debug folder I have:
businesslogic.dll
interfaces.dll
Microsoft.ApplicationBlocks.Data.dll
MySql.Data.dll (I know this won't be needed)
Umbraco.Courier.Core.dll
umbraco.DataLayer.dll
Umbraco.Licensing.dll
Using this setup, I can't see any PersistenceProviders loaded in the PersistenceManager, but as you said, I shouldn't need this.
I have used the default courier.config apart from adding my repository above:
<!-- Macro Property Types, that store Content IDs, to link to media or content -->
<add key="Media Current">mediaCurrent</add>
<add key="Content Subs">contentSubs</add>
<add key="Content Random">contentRandom</add>
<add key="Content picker">contentPicker</add>
<add key="Content tree">contentTree</add>
<add key="Content All">contentAll</add>
</contentPickers>
</macroPropertyTypeResolvers>
<resources>
<!-- files which should not added at any time-->
<ignore>
<add>/bin/*.pdb</add>
<add>/bin/*.xml</add>
<add>/bin/AjaxControlToolkit.dll</add>
<add>/bin/Antlr3.Runtime.dll</add>
<add>/bin/App_Browsers.dll</add>
<add>/bin/App_global.asax.dll</add>
<add>/bin/businesslogic.dll</add>
<add>/bin/Castle.*</add>
<add>/bin/ClientDependency.Core.dll</add>
<add>/bin/cms.dll</add>
<add>/bin/controls.dll</add>
<add>/bin/CookComputing.XmlRpcV2.dll</add>
<add>/bin/Examine.dll</add>
<add>/bin/FluentNHibernate.dll</add>
<add>/bin/htmlagilitypack.dll</add>
<add>/bin/ICSharpCode.SharpZipLib.dll</add>
<add>/bin/interfaces.dll</add>
<add>/bin/Iron*.dll</add>
<add>/bin/log4net.dll</add>
<add>/bin/Lucene.Net.dll</add>
<add>/bin/Microsoft.*.dll</add>
<add>/bin/MySql.Data.dll</add>
<add>/bin/NHibernate.*</add>
<add>/bin/RazorEngine.*.dll</add>
<add>/bin/System.Web.*</add>
<add>/bin/TidyNet.dll</add>
<add>/bin/Umbraco.Courier.*</add>
<add>/bin/umbraco.DataLayer.dll</add>
<add>/bin/UrlRewritingNet.UrlRewriter.dll</add>
<add>/bin/umbraco.dll</add>
</ignore>
</resources>
<!-- which types of relations should be supported by courier -->
<!-- Relations are only supported between content and media out of the box -->
<relations>
<add>relateOnCopy</add>
<!-- <add></add> -->
</relations>
</configuration>
I have tried running this against a Umbraco 4.7.2 test site aswell (swapping the 4.11.4 dll's for the 4.7.2 ones in my bin/debug folder) and got the same exception.
I forgot to mention that my test sites for packaging are just blank sites with the business starter kit installed. I have then installed Courier_2.7.3_2.7.3.39 on these (I assume Courier needs to be installed on the sites so the webservice etc. is installed). I have then stuck my umbracoCourier.lic file in the bin of these sites.
So I now have this packaging. It appears that the latest version of Courier requires both the Source and the Destination properties of the RevisionPackaging instance to be set. Previous versions of Courier allowed only the Source to be set as shown in the example on https://github.com/umbraco/Courier/tree/master/Samples/Umbraco.Courier.ExtractionConsole
Packaging with courier command line
I'm trying to do some simple packaging using the courier command line (on umbraco 4.11.4 with Courier_2.7.3_2.7.3.39) using the following:
I have a simple courier.config, with the only items of significance being my repository:
The code executes ok and everything seems initialized ok until I get to engine.Package() at which point I get the following exception:
System.Collections.Generic.KeyNotFoundException was unhandled
HResult=-2146232969
Message=The given key was not present in the dictionary.
Source=mscorlib
StackTrace:
at System.Collections.Generic.Dictionary`2.get_Item(TKey key)
at Umbraco.Courier.Core.PersistenceManager.get_Default()
at Umbraco.Courier.RepositoryProviders.Local.OpenSession(String key)
at Umbraco.Courier.Core.Packaging.RevisionPackaging.#Gb()
at Umbraco.Courier.Core.Packaging.RevisionPackaging.Package()
at Courier2.Program.Main(String[] args) in c:\Users\Jonny.Irwin\Documents\Visual Studio 2012\Projects\Courier2\Courier2\Program.cs:line 29
at System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()
InnerException:
Has anyone any ideas? I have my test site running on SQL CE in case that's an issue.
As further information:
Hmm, you should remove the Umbraco.Courier.Persistence.V4.dll as that is not near to being done yet.
the issue is that you are trying to use the Nhibernate datalayer, but you need all the nhibernate dependencies in place, have a look in the standard courier zip hotfix for all the dependencies that courier needs to work with the nhibernate provider.
Also, are you absolutely sure that it finds the config file, and connects properly to the repository, because if you connect to a remore repository, it shouldnt need any local persistence layer, as that is all handled on the server, not in the client.
/Per
It is definitely finding my config file and connecting to it as I can see all the items when they have been added to the queue before trying to package.
I have the following files in my solution which I have taken from a version of the console app that you provided me with quite some time ago.
In my plugins folder i have the following:
I forgot to mention that my test sites for packaging are just blank sites with the business starter kit installed. I have then installed Courier_2.7.3_2.7.3.39 on these (I assume Courier needs to be installed on the sites so the webservice etc. is installed). I have then stuck my umbracoCourier.lic file in the bin of these sites.
So I now have this packaging. It appears that the latest version of Courier requires both the Source and the Destination properties of the RevisionPackaging instance to be set. Previous versions of Courier allowed only the Source to be set as shown in the example on https://github.com/umbraco/Courier/tree/master/Samples/Umbraco.Courier.ExtractionConsole
is working on a reply...