Error executing template "Designs/TheGift_generated/Paragraph/DevelopmentBlock.cshtml" System.IO.IOException: The process cannot access the file 'D:\dynamicweb.net\Solutions\TheGift\Production\files\Templates\Designs\Backyard\DevBlocks\15913\devBlock.cshtml' because it is being used by another process. at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath) at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost) at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost) at System.IO.StreamWriter.CreateFile(String path, Boolean append, Boolean checkHost) at System.IO.StreamWriter..ctor(String path, Boolean append, Encoding encoding, Int32 bufferSize, Boolean checkHost) at System.IO.StreamWriter..ctor(String path, Boolean append, Encoding encoding) at Dynamicweb.Core.Helpers.TextFileHelper.WriteTextFile(String value, String path, Boolean appendToFile, Encoding encoding) at Bluedesk.DynamicWeb.ItemTypes.BaseSolution.DevelopmentBlock.WriteFile(String exstenstion, StringBuilder DevblockBuilder, String currentParagraphID) in C:\vso\TheGift\BluedeskBaseSolution\ClientBase\ItemTypes\Bluedesk.DynamicWeb.ItemTypes.BaseSolution\Elements\DevelopmentBlock.cs:line 173 at Bluedesk.DynamicWeb.ItemTypes.BaseSolution.DevelopmentBlock.CreateFile(String currentParagraphID, String ext, String template) in C:\vso\TheGift\BluedeskBaseSolution\ClientBase\ItemTypes\Bluedesk.DynamicWeb.ItemTypes.BaseSolution\Elements\DevelopmentBlock.cs:line 127 at Bluedesk.DynamicWeb.ItemTypes.BaseSolution.DevelopmentBlock.CreateTemplate(String currentParagraphID) in C:\vso\TheGift\BluedeskBaseSolution\ClientBase\ItemTypes\Bluedesk.DynamicWeb.ItemTypes.BaseSolution\Elements\DevelopmentBlock.cs:line 105 at Bluedesk.DynamicWeb.ItemTypes.BaseSolution.DevelopmentBlock.GetTemplate(String currentParagraphID, String itemId) in C:\vso\TheGift\BluedeskBaseSolution\ClientBase\ItemTypes\Bluedesk.DynamicWeb.ItemTypes.BaseSolution\Elements\DevelopmentBlock.cs:line 59 at CompiledRazorTemplates.Dynamic.RazorEngine_ec28fa7a65534b0db45d1fbef7d9bb06.Execute() in D:\dynamicweb.net\Solutions\TheGift\Production\files\Templates\Designs\TheGift_generated\Paragraph\DevelopmentBlock.cshtml:line 134 at RazorEngine.Templating.TemplateBase.RazorEngine.Templating.ITemplate.Run(ExecuteContext context, TextWriter reader) at RazorEngine.Templating.RazorEngineService.RunCompile(ITemplateKey key, TextWriter writer, Type modelType, Object model, DynamicViewBag viewBag) at RazorEngine.Templating.RazorEngineServiceExtensions.<>c__DisplayClass16_0.<RunCompile>b__0(TextWriter writer) at RazorEngine.Templating.RazorEngineServiceExtensions.WithWriter(Action`1 withWriter) at Dynamicweb.Rendering.RazorTemplateRenderingProvider.Render(Template template) at Dynamicweb.Rendering.TemplateRenderingService.Render(Template template) at Dynamicweb.Rendering.Template.RenderRazorTemplate() 1 @inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.ParagraphViewModel> 2 @using System.IO; 3 @using Dynamicweb; 4 @using Dynamicweb.Content; 5 @using Dynamicweb.Content.Items; 6 @using Dynamicweb.Security.Permissions; 7 @using Bluedesk.DynamicWeb.ItemTypes; 8 @using Bluedesk.DynamicWeb.ItemTypes.Configuration; 9 @using Bluedesk.DynamicWeb.ItemTypes.Settings.Configuration; 10 @using Dynamicweb.Frontend; 11 @using Dynamicweb.Frontend.Navigation 12 @using Dynamicweb.Ecommerce.ProductCatalog 13 @using Dynamicweb.Environment 14 @using Dynamicweb.Rendering; 15 @using Bluedesk.DynamicWeb.ItemTypes.BaseSolution; 16 17 18 @* 19 @inherits Dynamicweb.Rendering.RazorTemplateBase<Dynamicweb.Rendering.RazorTemplateModel<Dynamicweb.Rendering.Template>> 20 @using Dynamicweb; 21 @using Dynamicweb.Content.Items; 22 @using Bluedesk.DynamicWeb.ItemTypes; 23 24 @functions { 25 26 Dictionary<string, string> GetFontConfiguration(string TextColor, FontConfigurationItemTab FontConfiguration) 27 { 28 var colorService = new ColorSwatchService(); 29 TextColor = !string.IsNullOrWhiteSpace(TextColor) ? TextColor : "" ; 30 TextColor = !TextColor.Contains("#") ? colorService.GetHexColor(Pageview.AreaID, TextColor) : TextColor; 31 Dictionary<string, string> FontConfig = new Dictionary<string, string>() { 32 { "textColor" , TextColor }, 33 { "fontSize" , FontConfiguration.FontSize }, 34 { "lineHeight", FontConfiguration.LineHeight}, 35 { "fontFamily" , FontConfiguration.FontConfiguration.FontFamily }, 36 { "fontWeight" , FontConfiguration.FontWeight }, 37 { "fontStyle" , FontConfiguration.FontStyle } 38 }; 39 return FontConfig; 40 } 41 42 public string GenerateButtonConfigVariables(ButtonConfiguration BC, MasterConfig mc, int areaId) 43 { 44 string ButtonLabelAlignment = BC.ButtonLabelAlignment; 45 switch (ButtonLabelAlignment) 46 { 47 case "align-left": 48 ButtonLabelAlignment = "flex-start"; 49 break; 50 case "align-center": 51 ButtonLabelAlignment = "center"; 52 break; 53 case "align-right": 54 ButtonLabelAlignment = "flex-end"; 55 break; 56 case "align-full": 57 ButtonLabelAlignment = "space-between"; 58 break; 59 default: 60 ButtonLabelAlignment = "flex-start"; 61 break; 62 } 63 64 var btnStyleBlock = new System.Text.StringBuilder(); 65 66 // General Config 67 btnStyleBlock.Append(GenerateCssVar("btn-min-height", $"{mc.GeneralConfiguration.ButtonHeight}px")); 68 btnStyleBlock.Append(GenerateCssVar("btn-border-radius", $"{mc.GeneralConfiguration.RoundedCornerValue}px")); 69 70 // Button Config 71 btnStyleBlock.Append(GenerateCssVar("btn-border-width", $"{BC.BorderSize.ToString()}px")); 72 btnStyleBlock.Append(GenerateCssVar("btn-label-alignment", ButtonLabelAlignment)); 73 74 // Button Config Tab 75 btnStyleBlock.Append(GenerateCssVar("btn-bg-color", BC.ButtonColorConfiguration.BackgroundColor.GetColorCode(areaId))); 76 btnStyleBlock.Append(GenerateCssVar("btn-font-color", BC.ButtonColorConfiguration.FontColor.GetColorCode(areaId))); 77 btnStyleBlock.Append(GenerateCssVar("btn-border-color", BC.ButtonColorConfiguration.BorderColor.GetColorCode(areaId))); 78 79 // Button Config Hover tab 80 btnStyleBlock.Append(GenerateCssVar("btn-bg-color-hover", BC.ButtonHoverColorConfiguration.BackgroundColor.GetColorCode(areaId))); 81 btnStyleBlock.Append(GenerateCssVar("btn-font-color-hover", BC.ButtonHoverColorConfiguration.FontColor.GetColorCode(areaId))); 82 btnStyleBlock.Append(GenerateCssVar("btn-border-color-hover", BC.ButtonHoverColorConfiguration.BorderColor.GetColorCode(areaId))); 83 84 // Button Config Font Config 85 btnStyleBlock.Append(GenerateCssVar("btn-font-size", BC.FontConfiguration.FontSize)); 86 btnStyleBlock.Append(GenerateCssVar("btn-font-config-color", BC.FontConfiguration.Color.GetColorCode(areaId))); 87 btnStyleBlock.Append(GenerateCssVar("btn-font-line-height", BC.FontConfiguration.LineHeight)); 88 btnStyleBlock.Append(GenerateCssVar("btn-font-family", BC.FontConfiguration.FontConfiguration.FontFamily)); 89 btnStyleBlock.Append(GenerateCssVar("btn-font-weight", BC.FontConfiguration.FontWeight)); 90 btnStyleBlock.Append(GenerateCssVar("btn-font-transform", BC.FontConfiguration.FontStyle)); 91 92 return btnStyleBlock.ToString(); 93 } 94 95 public string GenerateCssVar(string name, string value) 96 { 97 if (!string.IsNullOrWhiteSpace(value)) { 98 return $"--{name}: {value};"; 99 } else { 100 return ""; 101 } 102 } 103 } 104 105 @inherits Dynamicweb.Rendering.RazorTemplateBase<Dynamicweb.Rendering.RazorTemplateModel<Dynamicweb.Rendering.Template>> 106 @using Dynamicweb; 107 @using Dynamicweb.Content.Items; 108 @using Bluedesk.DynamicWeb.ItemTypes; 109 @using Bluedesk.DynamicWeb.ItemTypes.Extensions; 110 @using Bluedesk.DynamicWeb.ItemTypes.Configuration; 111 @using Bluedesk.DynamicWeb.ItemTypes.Settings.Configuration; 112 @using Dynamicweb; 113 @using Dynamicweb.Frontend 114 @using Bluedesk.DynamicWeb.ItemTypes.BaseSolution; 115 116 @helper RenderButton(CTAButton button, PageView Pageview) 117 { 118 119 if (!string.IsNullOrWhiteSpace(button.GetLink(Pageview))) 120 { 121 string Template = button.GetButtonTemplate().Replace("{{ ButtonLink }}", button.GetLink(Pageview)); 122 @Template; 123 } 124 } 125 *@ 126 127 @{ 128 string currentParagraphID = Pageview.CurrentParagraph.ID.ToString(); 129 string itemId = Pageview.CurrentParagraph.ItemId.ToString(); 130 } 131 132 133 @{ 134 @DevelopmentBlock.GetTemplate(currentParagraphID, itemId) 135 } 136 137 Contact Inloggen Nieuwsbrief
Ga op avontuur met NORLÄNDER Eigentijdse tassen, trolleys, sport en outdoor producten Ontdek Norländer
Maak van je huis een thuis met JENS Living Stijlvolle woon-, keuken-, en tuin accessoires Ontdek JENS Living