Error executing template "Designs/identity_b2c/_parsed/espresso.parsed.cshtml"
System.NullReferenceException: Object reference not set to an instance of an object.
   at CompiledRazorTemplates.Dynamic.RazorEngine_c75e01d23a2642dfa20c0b570a058f6d.Execute() in D:\dynamicweb.net\Solutions\id.espresso4.dk\Files\Templates\Designs\identity_b2c\_parsed\espresso.parsed.cshtml:line 24
   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.b__0(TextWriter writer)
   at RazorEngine.Templating.RazorEngineServiceExtensions.WithWriter(Action`1 withWriter)
   at Dynamicweb.Rendering.Template.RenderRazorTemplate()

1 @inherits Co3.Espresso.Website.TemplateBases.Pages.PageBase 2 @using System.IO 3 @using System.Web 4 @using System.Globalization 5 @using Dynamicweb.Frontend 6 @using Dynamicweb.Ecommerce.Common 7 @using Dynamicweb.Security.UserManagement 8 @{ 9 bool isUserAuthenticated = User.IsExtranetUserLoggedIn(); 10 11 string globalAreaLang = PageView.Current().Area.CultureInfo.TwoLetterISOLanguageName; 12 string globalAreaName = PageView.Current().Area.UrlName; 13 string shopContext = PageView.Current().Area.Item["BrandB2C"]?.ToString().ToLowerInvariant(); 14 bool globalPrefix = PageView.Current().Area.UrlIgnoreForChildren; 15 if (globalPrefix == true) 16 { 17 globalAreaName = string.Empty; 18 } 19 CultureInfo currencyCulture = new CultureInfo( Context.Currency.CultureInfo ); 20 string currencySeparatorDecimal = currencyCulture.NumberFormat.NumberDecimalSeparator; 21 string currencySeparatorInteger = currencyCulture.NumberFormat.NumberGroupSeparator; 22 string openGraphUrl = PageView.Current().SearchFriendlyUrl; 23 string openGraphImage = HttpContext.Current.Request.Url.Scheme + "://" + HttpContext.Current.Request.Url.Host + Espresso.OpenGraphImage; 24 bool loadGoogleTagManager = !string.IsNullOrEmpty( Espresso.Area.GoogleTagManagerID ) && 25 !(Espresso.Area.Item.GoogleTagManagerDisableIfPerformanceTestIsDetected == "True" && HttpContext.Current.Request.UserAgent.ToLower().Contains( "lighthouse" )); 26 27 string espressoCriticalJsFile = HttpContext.Current.Server.MapPath("/Files/Templates/Designs/identity_b2c/_assets/_dist/js/critical.js"); 28 string espressoCriticalJs = File.ReadAllText(espressoCriticalJsFile); 29 30 string espressoCriticalCssFile = HttpContext.Current.Server.MapPath("/Files/Templates/Designs/identity_b2c/_assets/_dist/css/critical.css"); 31 string espressoCriticalCss = File.ReadAllText(espressoCriticalCssFile); 32 33 } 34 <!DOCTYPE html> 35 <html lang="@globalAreaLang" data-separator-integer="@currencySeparatorInteger" data-separator-decimal="@currencySeparatorDecimal" data-area="@globalAreaName" data-state="@shopContext" data-context="id"> 36 <head> 37 @GetValue( "CopyRightNotice" ) 38 <meta charset="utf-8"> 39 <meta content="width=device-width, initial-scale=1, shrink-to-fit=no, minimal-ui" name="viewport"> 40 <meta content="ie=edge" http-equiv="x-ua-compatible"> 41 <link href="https://cdnjs.cloudflare.com" rel="preconnect"> 42 <link href="https://www.googletagmanager.com" rel="preconnect"> 43 <link href="https://www.google-analytics.com" rel="preconnect"> 44 <link href="https://connect.facebook.net" rel="preconnect"> 45 <title>@GetValue("Title")</title> 46 <style> 47 @espressoCriticalCss 48 </style> 49 @RenderSnippet( "webfonts" ) 50 <link href="/Files/Templates/Designs/identity_b2c/_assets/_dist/css/default.css?v=1.06" media="@Espresso.StylesheetAttributeMedia" rel="@Espresso.StylesheetAttributeRel" as="style"> 51 <script> 52 @espressoCriticalJs 53 </script> 54 <link rel="shortcut icon" href="@Espresso.Area.Item.Favicon"> 55 <meta name="description" content="@Espresso.DynamicwebPage.Description"> 56 @GetValue( "MetaTags" ) 57 @if ( Espresso.IsStagingUrl ) 58 { 59 <meta content="noindex,nofollow" name="robots"> 60 } 61 <meta property="og:url" content="@openGraphUrl"> 62 <meta property="og:title" content="@Espresso.OpenGraphTitle"> 63 <meta property="og:description" content="@Espresso.OpenGraphDescription"> 64 <meta property="og:image" content="@openGraphImage"> 65 <meta property="og:type" content="website"> 66 @if ( string.IsNullOrEmpty( Espresso.Area.Item.GoogleSiteVerification ) == false ) 67 { 68 <meta name="google-site-verification" content="@Espresso.Area.Item.GoogleSiteVerification"> 69 } 70 71 <script> 72 window.dataLayer = window.dataLayer || []; 73 function gtag() { 74 dataLayer.push(arguments); 75 } 76 gtag('consent', 'default', { 77 ad_storage: 'denied', 78 analytics_storage: 'denied', 79 wait_for_update: 500, 80 }); 81 gtag('set', 'ads_data_redaction', true); 82 </script> 83 84 <script id="CookieConsent" src="https://policy.app.cookieinformation.com/uc.js" data-culture="@globalAreaLang" type="text/javascript"></script> 85 @if ( loadGoogleTagManager ) 86 { 87 88 <!-- Google Tag Manager --> 89 <script> 90 (function(w, d, s, l, i) { 91 w[l] = w[l] || []; 92 w[l].push({ 93 'gtm.start': 94 new Date().getTime(), 95 event: 'gtm.js' 96 }); 97 var f = d.getElementsByTagName(s)[0], 98 j = d.createElement(s), 99 dl = l != 'dataLayer' ? '&l=' + l : ''; 100 j.async = true; 101 j.src = 102 'https://www.googletagmanager.com/gtm.js?id=' + i + dl; 103 f.parentNode.insertBefore(j, f); 104 })(window, document, 'script', 'dataLayer', '@Espresso.Area.GoogleTagManagerID'); 105 </script> 106 <!-- End Google Tag Manager --> 107 } 108 109 <!-- Start of Sleeknote signup and lead generation tool - www.sleeknote.com --> 110 <script id='sleeknoteScript' type='text/javascript'> 111 (function () { var sleeknoteScriptTag = document.createElement('script'); 112 sleeknoteScriptTag.type = 'text/javascript'; 113 sleeknoteScriptTag.charset = 'utf-8'; 114 sleeknoteScriptTag.src = ('//sleeknotecustomerscripts.sleeknote.com/25665.js'); 115 var s = document.getElementById('sleeknoteScript'); 116 s.parentNode.insertBefore(sleeknoteScriptTag, s); 117 })(); 118 </script> 119 <!-- End of Sleeknote signup and lead generation tool - www.sleeknote.com --> 120 121 <!-- Hotjar Tracking Code for www.id.dk --> 122 <script> 123 (function(h,o,t,j,a,r){ 124 h.hj=h.hj||function(){(h.hj.q=h.hj.q||[]).push(arguments)}; 125 h._hjSettings={hjid:2142705,hjsv:6}; 126 a=o.getElementsByTagName('head')[0]; 127 r=o.createElement('script');r.async=1; 128 r.src=t+h._hjSettings.hjid+j+h._hjSettings.hjsv; 129 a.appendChild(r); 130 })(window,document,'https://static.hotjar.com/c/hotjar-','.js?sv='); 131 </script> 132 133 134 </head> 135 136 <body class="@Espresso.Item.CustomClasses" data-is-user-authenticated="@isUserAuthenticated.ToString().ToLower()" data-design="@Espresso.Area.DesignsFolderName"> 137 @if ( loadGoogleTagManager ) 138 { 139 <!-- Google Tag Manager (noscript) --> 140 <noscript> 141 <iframe src="https://www.googletagmanager.com/ns.html?id=@Espresso.Area.GoogleTagManagerID" height="0" width="0" style="display: none; visibility: hidden"></iframe> 142 </noscript> 143 <!-- End Google Tag Manager (noscript) --> 144 } 145 @using Co3.Espresso.Website.Models.FrontEnd 146 @using Co3.Espresso.Website.Models.FrontEnd.Settings 147 @using Co3.Espresso.Website.Services 148 @inherits Co3.Espresso.Website.TemplateBases.Pages.PageBase 149 @{ 150 Espresso.Canvas.Classes.AddClasses( "js-e-canvas is-loading" ); 151 if ( Espresso.Item.CanvasFullscreen == "True" ) 152 { 153 Espresso.Canvas.Classes.AddClasses( "is-fullscreen" ); 154 } 155 } 156 157 158 159 <div class="e-loading-overlay e-page-loading-overlay is-loading js-e-page-loading-overlay"> 160 @RenderingService.Instance.PartialView( "_partials/loading-spinner.cshtml" ) 161 </div> 162 163 @RenderingService.Instance.PartialView( "_partials/webfonts.cshtml", Espresso ) 164 165 <div class="@Espresso.Canvas.Classes"> 166 @RenderingService.Instance.PartialView( "_partials/header.cshtml", Espresso ) 167 @RenderingService.Instance.PartialView( "usermanagement/viewprofile/espresso-impersonate-user-msg.cshtml", Espresso ) 168 <main id="dwcontentmain" class="e-content js-e-content @Espresso.ContentArea.Classes"> 169 @RenderingService.Instance.PartialView( "_partials/breadcrumb.cshtml", Espresso ) 170 <article class="e-content-article"> 171 @RenderingService.Instance.PartialView( "_partials/nav-local-horizontal.cshtml", Espresso ) 172 @RenderingService.Instance.PartialView( "_partials/nav-local-vertical.cshtml", Espresso ) 173 @RenderingService.Instance.SectionStart( new SectionSettings() ) 174 @GetValue("DwContent(dwcontentmain)") 175 @RenderingService.Instance.SectionEnd() 176 </article> 177 </main> 178 179 @RenderingService.Instance.PartialView( "_partials/footer.cshtml", Espresso ) 180 181 @if ( !string.IsNullOrEmpty( GetString( "DwContent(dwcontentcta)" ) ) ) 182 { 183 <aside class="e-cta fixed-top is-hidden js-e-cta" id="dwcontentcta"> 184 @RenderingService.Instance.SectionStart( new SectionSettings 185 { 186 ContentClasses = new ClassList( "col-12" ), 187 OuterRowClasses = new ClassList("row no-gutters"), 188 InnerRowClasses = new ClassList("row no-gutters justify-content-center align-items-center") 189 } ) 190 @GetValue("DwContent(dwcontentcta)") 191 @RenderingService.Instance.SectionEnd() 192 193 </aside> 194 } 195 196 @RenderingService.Instance.PartialView( "ecom7/cartv2/step/espresso-cart-msg.cshtml" ) 197 </div> 198 199 @RenderingService.Instance.PartialView( "_partials/search.cshtml", Espresso ) 200 201 @RenderingService.Instance.PartialView( "_partials/back-to-top.cshtml", Espresso ) 202 @RenderingService.Instance.PartialView("/Extranet/partials/identity-login.cshtml", Espresso) 203 204 @if ( 1 == 2 ) 205 { 206 @GetValue("DwCookieWarning") 207 } 208 209 <script async="" src="/Files/Templates/Designs/identity_b2c/_assets/_dist/js/default.js?v=1.41"></script> 210 </body> 211 212 @GetValue( "CopyRightNotice" ) 213 </html> 214