I'm wondering how to approach the export process for an EpiServer site when using an MS Build custom task. (I'm testing in a WinForms app)
I have some code that exports in a web page, but when I transfer it to the winforms app, I get an error :"Page transfer has to have a class factory to work with!"
Any suggestions would be appreciated, the code is below...
Thanks,
Andrew
ps: I've copied the web.config of the site into the test app and renamed it app.config
DataExporter Exporter = new DataExporter(ClassFactoryRegistry.Factory("EPiServer.BaseLibrary.ClassFactory") as DecoratedClassFactory);
DataExporter Exporter = new DataExporter(ClassFactoryRegistry.Factory("EPiServer.Enterprise.Transfer.ClassFactory") as DecoratedClassFactory);// Create an output streamstring exportFile = @"c:\test_dump\99_test_epi_output.dat"; //Path.GetTempFileName();Exporter.Stream = new FileStream(exportFile, FileMode.Create, FileAccess.ReadWrite, FileShare.None); // Add pages to the export package, here alla pages below the startpagePageReference pr = new PageReference(3);Exporter.SourceRoots.Add(new ExportSource(pr,ExportSource.RecursiveLevelInfinity)); // Export all pagesExporter.Export(); // Close the exporterExporter.Close(); // Close the out file Exporter.Stream.Close();
Hi,
I'm wondering how to approach the export process for an EpiServer site when using an MS Build custom task. (I'm testing in a WinForms app)
I have some code that exports in a web page, but when I transfer it to the winforms app, I get an error :"Page transfer has to have a class factory to work with!"
Any suggestions would be appreciated, the code is below...
Thanks,
Andrew
ps: I've copied the web.config of the site into the test app and renamed it app.config
// Add pages to the export package, here alla pages below the startpage PageReference pr = new PageReference(3); Exporter.SourceRoots.Add(new ExportSource(pr, ExportSource.RecursiveLevelInfinity));
// Export all pages Exporter.Export();
// Close the exporter Exporter.Close();
// Close the out file Exporter.Stream.Close();