diff --git a/src/Orchard.Web/Modules/Orchard.Recipes/Services/RecipeJournalManager.cs b/src/Orchard.Web/Modules/Orchard.Recipes/Services/RecipeJournalManager.cs index 609401e9b..2555711b8 100644 --- a/src/Orchard.Web/Modules/Orchard.Recipes/Services/RecipeJournalManager.cs +++ b/src/Orchard.Web/Modules/Orchard.Recipes/Services/RecipeJournalManager.cs @@ -11,6 +11,22 @@ namespace Orchard.Recipes.Services { public class RecipeJournalManager : IRecipeJournal { private readonly IStorageProvider _storageProvider; private readonly string _recipeJournalFolder = "RecipeJournal" + Path.DirectorySeparatorChar; + private const string WebConfig = +@" + + + + + + + + + + + + + +"; public RecipeJournalManager(IStorageProvider storageProvider) { _storageProvider = storageProvider; @@ -78,7 +94,11 @@ namespace Orchard.Recipes.Services { IStorageFile journalFile; var journalPath = Path.Combine(_recipeJournalFolder, executionId); try { - _storageProvider.TryCreateFolder(_recipeJournalFolder); + if (_storageProvider.TryCreateFolder(_recipeJournalFolder)) { + var webConfigPath = Path.Combine(_recipeJournalFolder, "web.config"); + var webConfigFile = _storageProvider.CreateFile(webConfigPath); + WriteWebConfig(webConfigFile); + } journalFile = _storageProvider.GetFile(journalPath); } catch (ArgumentException) { @@ -109,6 +129,14 @@ namespace Orchard.Recipes.Services { } } + private static void WriteWebConfig(IStorageFile webConfigFile) { + using (var stream = webConfigFile.OpenWrite()) { + using (var tw = new StreamWriter(stream)) { + tw.Write(WebConfig); + } + } + } + private static RecipeStatus ReadStatusFromJournal(XElement xElement) { switch (xElement.Element("Status").Value) { case "Started":