Error executing template "Designs/Swift/_parsed/Swift_Fonts_Collection.parsed.cshtml"
System.IO.FileLoadException: Could not load file or assembly 'dotless.Core, Version=1.6.7.0, Culture=neutral, PublicKeyToken=96b446c9e63eae34' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
File name: 'dotless.Core, Version=1.6.7.0, Culture=neutral, PublicKeyToken=96b446c9e63eae34'
   at Dna.Optimizer.Renderer.RenderStyles(OptimizerSettings settings)
   at CompiledRazorTemplates.Dynamic.RazorEngine_ac8a856de92844d3a3e09e149a34c0a3.Execute() in F:\Domains\Sites\swiftrizzo.mydwsite3.com\Files\Templates\Designs\Swift\_parsed\Swift_Fonts_Collection.parsed.cshtml:line 87
   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()
WRN: Assembly binding logging is turned OFF.
To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1.
Note: There is some performance penalty associated with assembly bind failure logging.
To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog].

1 @inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.PageViewModel> 2 @using System.Linq 3 @using Dna.Optimizer 4 @using Dynamicweb 5 @using Dynamicweb.Environment 6 7 @functions { 8 string GetCookieOptInPermission(string category) 9 { 10 bool categoryOrAllGranted = false; 11 12 if (CookieManager.IsCookieManagementActive) 13 { 14 var cookieOptInLevel = CookieManager.GetCookieOptInLevel(); 15 var cookieOptInCategories = CookieManager.GetCookieOptInCategories(); 16 categoryOrAllGranted = cookieOptInCategories.Contains(category) || cookieOptInLevel == CookieOptInLevel.All; 17 } 18 19 return categoryOrAllGranted ? "granted" : "denied"; 20 } 21 22 bool AllowTracking() 23 { 24 bool allowTracking = true; 25 if (CookieManager.IsCookieManagementActive) 26 { 27 var cookieOptInLevel = CookieManager.GetCookieOptInLevel(); 28 var cookieOptInCategories = CookieManager.GetCookieOptInCategories(); 29 30 bool consentEither = (cookieOptInCategories.Contains("Statistical") || cookieOptInCategories.Contains("Marketing")); 31 bool consentFunctional = cookieOptInLevel == CookieOptInLevel.Functional; 32 bool consentAtLeastOne = cookieOptInLevel == CookieOptInLevel.All || (consentFunctional && consentEither); 33 34 allowTracking = consentAtLeastOne; 35 } 36 return allowTracking; 37 } 38 } 39 40 @{ 41 string swiftVersion = ReadFile("/Files/Templates/Designs/Swift/swift_version.txt"); 42 @* Branding Themes Fonts *@ 43 var brandingPageId = Model.Area.Item.GetLink("BrandingPage") != null ? Model.Area.Item.GetLink("BrandingPage").PageId : 0; 44 var themePageId = Model.Area.Item.GetLink("ThemesPage") != null ? Model.Area.Item.GetLink("ThemesPage").PageId : 0; 45 46 var disableWideBreakpoints = Model.Area?.Item?.GetRawValueString("DisableWideBreakpoints", "default"); 47 48 string customHeaderInclude = Model.Area.Item.GetFile("CustomHeaderInclude") != null ? Model.Area.Item.GetFile("CustomHeaderInclude").Name : string.Empty; 49 50 string customBodyInclude = Model.Area.Item.GetFile("CustomBodyInclude") != null ? Model.Area.Item.GetFile("CustomBodyInclude").Name : string.Empty; 51 52 string masterTheme = !string.IsNullOrWhiteSpace(Model.Area.Item.GetRawValueString("Theme")) ? " theme " + Model.Area.Item.GetRawValueString("Theme").Replace(" ", "").Trim().ToLower() : ""; 53 54 string favicon = Model.Area.Item.GetFile("Favicon") != null ? Model.Area.Item.GetFile("Favicon").Path : "/Files/Templates/Designs/Swift/Assets/Images/favicon.png"; 55 56 var brandingPage = Dynamicweb.Content.Services.Pages?.GetPage(brandingPageId) ?? null; 57 var themesParagraphLastChanged = Dynamicweb.Content.Services.Paragraphs.GetParagraphsByPageId(themePageId).OrderByDescending(p => p.Audit.LastModifiedAt).FirstOrDefault(); 58 var cssLastModified = brandingPage.Audit.LastModifiedAt > themesParagraphLastChanged.Audit.LastModifiedAt ? brandingPage.Audit.LastModifiedAt : themesParagraphLastChanged.Audit.LastModifiedAt; 59 60 var cssStyleFileInfo = new System.IO.FileInfo(Dynamicweb.Core.SystemInformation.MapPath("/Files/Templates/Designs/Swift/Assets/css/styles.css")); 61 var jsFileInfo = new System.IO.FileInfo(Dynamicweb.Core.SystemInformation.MapPath("/Files/Templates/Designs/Swift/Assets/js/scripts.js")); 62 63 string googleTagManagerID = Model.Area.Item.GetString("GoogleTagManagerID"); 64 string googleAnalyticsMeasurementID = Pageview.AreaSettings.GetString("GoogleAnalyticsMeasurementID"); 65 66 bool allowTracking = AllowTracking(); 67 68 // Schema.org details for PDP 69 string productId = !string.IsNullOrEmpty(Dynamicweb.Context.Current.Request.QueryString.Get("ProductID")) ? Dynamicweb.Context.Current.Request.QueryString.Get("ProductID") : ""; 70 bool isProductDetailsPage = !string.IsNullOrEmpty(productId); 71 bool isArticlePage = Model.ItemType == "Swift_Article"; 72 string schemaOrgType = string.Empty; 73 74 if (isProductDetailsPage) 75 { 76 schemaOrgType = "itemscope=\"\" itemtype=\"https://schema.org/Product\""; 77 } 78 79 if (isArticlePage) 80 { 81 schemaOrgType = "itemscope=\"\" itemtype=\"https://schema.org/Article\""; 82 } 83 84 var rizzoJsInfo = new System.IO.FileInfo(Dynamicweb.Core.SystemInformation.MapPath("~/Files/Templates/Designs/Swift/Assets/js/rizzo/sr-helpers-min.js")); 85 var minify = !Model.Area.Item.GetBoolean("DisableMinification"); 86 var targetLocation = $"/Files/Templates/Optimizer/{Pageview.AreaID}"; 87 var customCssOptimizerBundle = Dna.Optimizer.Renderer.RenderStyles(new OptimizerSettings { RootFolder = "/Files/Templates/Designs/Swift/Assets/custom-css", VirtualPathPrefix = $"-custom-{Pageview.AreaID}", TargetLocation = targetLocation, Minify = minify, Recursive = false, FoldersFirst = false }); 88 var customJsOptimizerBundle = Dna.Optimizer.Renderer.RenderScripts(new OptimizerSettings { RootFolder = "/Files/Templates/Designs/Swift/Assets/custom-js", VirtualPathPrefix = $"-custom-{Pageview.AreaID}", TargetLocation = targetLocation, Minify = minify, Recursive = false, FoldersFirst = false }); 89 } 90 91 <!doctype html> 92 <html lang="@Pageview.Area.CultureInfo.TwoLetterISOLanguageName"> 93 <head> 94 <!-- @swiftVersion --> 95 @* Required meta tags *@ 96 <meta charset="utf-8"> 97 <meta name="viewport" content="height=device-height, width=device-width, initial-scale=1.0"> 98 <link rel="preload" href="/Files/Templates/Designs/Swift/Assets/css/styles.css?@cssStyleFileInfo.LastWriteTime.Ticks" as="style"> 99 <link rel="preload" href="/Files/Templates/Designs/Swift/Assets/js/scripts.js?@jsFileInfo.LastWriteTime.Ticks" as="script"> 100 101 <link rel="preload" href="/Files/Templates/Designs/Swift/Assets/js/rizzo/sr-helpers-min.js?@rizzoJsInfo.LastWriteTime.Ticks" as="script"> 102 @if (!string.IsNullOrEmpty(customCssOptimizerBundle)) 103 { 104 <link rel="preload" href="@customCssOptimizerBundle" as="style"> 105 } 106 @if (!string.IsNullOrEmpty(customJsOptimizerBundle)) 107 { 108 <link rel="preload" href="@customJsOptimizerBundle" as="script"> 109 } 110 111 <link rel="shortcut icon" href="@favicon"> 112 <link rel="apple-touch-icon" href="/Files/Templates/Designs/Swift/Assets/Images/logo_transparent.png"> 113 <meta http-equiv="X-UA-Compatible" content="ie=edge"> 114 <meta name="googlebot-news" content="nosnippet"> 115 116 @Model.MetaTags 117 118 <title>@Model.Title</title> 119 120 @* Bootstrap + Swift stylesheet *@ 121 <link href="/Files/Templates/Designs/Swift/Assets/css/styles.css?@cssStyleFileInfo.LastWriteTime.Ticks" rel="stylesheet" media="all" type="text/css"> 122 123 @if (disableWideBreakpoints != "disableBoth") 124 { 125 <style> 126 @@media ( min-width: 1600px ) { 127 .container-xxl, 128 .container-xl, 129 .container-lg, 130 .container-md, 131 .container-sm, 132 .container { 133 max-width: 1520px; 134 } 135 } 136 </style> 137 138 if (disableWideBreakpoints != "disableUltraWideOnly") 139 { 140 <style> 141 @@media ( min-width: 1920px ) { 142 .container-xxl, 143 .container-xl, 144 .container-lg, 145 .container-md, 146 .container-sm, 147 .container { 148 max-width: 1820px; 149 } 150 } 151 </style> 152 } 153 } 154 155 @* Branding and Themes min stylesheet *@ 156 <link href="/Files/Templates/Designs/Swift/_parsed/Swift_css/Swift_styles_@(Model.Area.ID).min.css?@cssLastModified.Ticks" rel="stylesheet" media="all" type="text/css" data-last-modified-content="@cssLastModified"> 157 <script src="/Files/Templates/Designs/Swift/Assets/js/scripts.js?@jsFileInfo.LastWriteTime.Ticks"></script> 158 159 <script type="module"> 160 swift.Scroll.hideHeadersOnScroll(); 161 swift.Scroll.handleAlternativeTheme(); 162 163 //Only load if AOS 164 const aosColumns = document.querySelectorAll('[data-aos]'); 165 if (aosColumns.length > 0) { 166 swift.AssetLoader.Load('/Files/Templates/Designs/Swift/Assets/js/aos.js?@jsFileInfo.LastWriteTime.Ticks', 'js'); 167 document.addEventListener('load.swift.assetloader', function () { 168 AOS.init({ duration: 400, delay: 100, easing: 'ease-in-out', mirror: false, disable: window.matchMedia('(prefers-reduced-motion: reduce)') }); 169 }); 170 } 171 </script> 172 173 @* Google gtag method - always include even if it is not used for anything *@ 174 <script> 175 window.dataLayer = window.dataLayer || []; 176 function gtag() { dataLayer.push(arguments); } 177 </script> 178 @* Google tag manager *@ 179 @if (!string.IsNullOrWhiteSpace(googleTagManagerID)) 180 { 181 <script> 182 gtag('consent', 'default', { 183 'ad_storage': 'denied', 184 'ad_user_data': 'denied', 185 'ad_personalization': 'denied', 186 'analytics_storage': 'denied' 187 }); 188 </script> 189 <script> 190 (function (w, d, s, l, i) { 191 w[l] = w[l] || []; w[l].push({ 192 'gtm.start': 193 new Date().getTime(), event: 'gtm.js' 194 }); var f = d.getElementsByTagName(s)[0], 195 j = d.createElement(s), dl = l != 'dataLayer' ? '&l=' + l : ''; j.async = true; j.src = 196 'https://www.googletagmanager.com/gtm.js?id=' + i + dl; f.parentNode.insertBefore(j, f); 197 })(window, document, 'script', 'dataLayer', '@(googleTagManagerID)'); 198 </script> 199 if (allowTracking) 200 { 201 string adConsent = GetCookieOptInPermission("Marketing"); 202 string analyticsConsent = GetCookieOptInPermission("Statistical"); 203 <script> 204 gtag('consent', 'update', { 205 'ad_storage': '@adConsent', 206 'ad_user_data': '@adConsent', 207 'ad_personalization': '@adConsent', 208 'analytics_storage': '@analyticsConsent' 209 }); 210 </script> 211 } 212 } 213 214 @if (!string.IsNullOrWhiteSpace(googleAnalyticsMeasurementID) && allowTracking) 215 { 216 var GoogleAnalyticsDebugMode = ""; 217 218 if (Model.Area.Item.GetBoolean("EnableGoogleAnalyticsDebugMode")) 219 { 220 GoogleAnalyticsDebugMode = ", {'debug_mode': true}"; 221 } 222 223 <script async src="https://www.googletagmanager.com/gtag/js?id=@googleAnalyticsMeasurementID"></script> 224 <script> 225 gtag('js', new Date()); 226 gtag('config', '@googleAnalyticsMeasurementID'@GoogleAnalyticsDebugMode); 227 </script> 228 } 229 230 @if (!string.IsNullOrWhiteSpace(customHeaderInclude)) 231 { 232 @RenderPartial($"Components/Custom/{customHeaderInclude}") 233 } 234 235 @* Rizzo *@ 236 <script src="/Files/Templates/Designs/Swift/Assets/js/rizzo/sr-helpers-min.js?@rizzoJsInfo.LastWriteTime.Ticks" async></script> 237 @if (!string.IsNullOrEmpty(customCssOptimizerBundle)) 238 { 239 <link href="@customCssOptimizerBundle" rel="stylesheet" media="all" type="text/css"> 240 } 241 @if (!string.IsNullOrEmpty(customJsOptimizerBundle)) 242 { 243 <script src="@customJsOptimizerBundle" defer></script> 244 } 245 </head> 246 247 <body class="brand @(masterTheme)"> 248 249 @* Google tag manager *@ 250 @if (!string.IsNullOrWhiteSpace(googleTagManagerID) && allowTracking) 251 { 252 <noscript> 253 <iframe src="https://www.googletagmanager.com/ns.html?id=@(googleTagManagerID)" 254 height="0" width="0" style="display:none;visibility:hidden"></iframe> 255 </noscript> 256 } 257 258 <div data-intersect></div> 259 260 <main id="content" @(schemaOrgType)> 261 @inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.PageViewModel> 262 263 264 265 <style> 266 .font-wrapper > *{ 267 font-family: var(--font-family); 268 font-weight: var(--font-weight); 269 font-style: var(--font-style); 270 } 271 </style> 272 273 <div class="container my-5"> 274 <div class="grid gap-3 mb-5 pb-3 text-center border-bottom"> 275 <div class="g-col-12"> 276 <h1 class="h1">@Translate("Custom fonts") </h1> 277 <div class="lead">@Translate("A list of all custom fonts")</div> 278 </div> 279 </div> 280 <div class="grid gap-3"> 281 @Model.Placeholder("content", "content", "default:true;sort:1") 282 </div> 283 </div> 284 285 @{ 286 string cssPathEcommerceBadges = Dynamicweb.Context.Current.Server.MapPath($"/Files/Templates/Designs/Swift/_parsed/Swift_css/Swift_ecommerce_badge_styles_{Model.Area.ID}.css"); 287 string cssPathTheme = Dynamicweb.Context.Current.Server.MapPath($"/Files/Templates/Designs/Swift/_parsed/Swift_css/Swift_theme_styles_{Model.Area.ID}.css"); 288 string cssPathFont = Dynamicweb.Context.Current.Server.MapPath($"/Files/Templates/Designs/Swift/_parsed/Swift_css/Swift_font_styles_{Model.Area.ID}.css"); 289 string cssPathBranding = Dynamicweb.Context.Current.Server.MapPath($"/Files/Templates/Designs/Swift/_parsed/Swift_css/Swift_branding_styles_{Model.Area.ID}.css"); 290 string cssPathCss = Dynamicweb.Context.Current.Server.MapPath($"/Files/Templates/Designs/Swift/_parsed/Swift_css/Swift_css_styles_{Model.Area.ID}.css"); 291 string cssPathCombined = Dynamicweb.Context.Current.Server.MapPath($"/Files/Templates/Designs/Swift/_parsed/Swift_css/Swift_styles_{Model.Area.ID}.min.css"); 292 293 string tmpPath = Dynamicweb.Context.Current.Server.MapPath($"/Files/Templates/Designs/Swift/_parsed/Swift_css/Swift_font_styles_{Model.Area.ID}.tmp"); 294 Dynamicweb.Core.Helpers.TextFileHelper.WriteTextFile(Dynamicweb.Core.Helpers.TextFileHelper.ReadTextFile(tmpPath), cssPathFont, false); 295 System.IO.File.Delete(tmpPath); 296 297 string combinedCss = Dynamicweb.Core.Helpers.TextFileHelper.ReadTextFile(cssPathBranding); 298 combinedCss += Dynamicweb.Core.Helpers.TextFileHelper.ReadTextFile(cssPathTheme); 299 combinedCss += Dynamicweb.Core.Helpers.TextFileHelper.ReadTextFile(cssPathFont); 300 combinedCss += Dynamicweb.Core.Helpers.TextFileHelper.ReadTextFile(cssPathEcommerceBadges); 301 combinedCss += Dynamicweb.Core.Helpers.TextFileHelper.ReadTextFile(cssPathCss); 302 combinedCss = System.Text.RegularExpressions.Regex.Replace(combinedCss, @"\{([\s\S]*?)\}", match => 303 { 304 string content = match.Groups[1].Value; 305 content = System.Text.RegularExpressions.Regex.Replace(content, @"\s+", " "); // Collapse multiple spaces to a single space 306 return "{" + content.Trim() + "}"; 307 }); 308 combinedCss = System.Text.RegularExpressions.Regex.Replace(combinedCss, @"\t|\n|\r", ""); 309 combinedCss = combinedCss.Replace("\00a0", " "); //Re-insert spaces for content text 310 Dynamicweb.Core.Helpers.TextFileHelper.WriteTextFile(combinedCss, cssPathCombined, false); 311 } 312 313 </main> 314 315 @* Render any offcanvas menu here *@ 316 @RenderSnippet("offcanvas") 317 318 @if (!string.IsNullOrWhiteSpace(customBodyInclude)) 319 { 320 @RenderPartial($"Components/Custom/{customBodyInclude}") 321 } 322 </body> 323 324 </html> 325