Error executing template "Designs/identity_v2/_parsed/espresso.parsed.cshtml"
System.Data.SqlClient.SqlException (0x80131904): A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server) ---> System.ComponentModel.Win32Exception (0x80004005): The network path was not found
   at System.Data.ProviderBase.DbConnectionPool.TryGetConnection(DbConnection owningObject, UInt32 waitForMultipleObjectsTimeout, Boolean allowCreate, Boolean onlyOneCheckConnection, DbConnectionOptions userOptions, DbConnectionInternal& connection)
   at System.Data.ProviderBase.DbConnectionPool.TryGetConnection(DbConnection owningObject, TaskCompletionSource`1 retry, DbConnectionOptions userOptions, DbConnectionInternal& connection)
   at System.Data.ProviderBase.DbConnectionFactory.TryGetConnection(DbConnection owningConnection, TaskCompletionSource`1 retry, DbConnectionOptions userOptions, DbConnectionInternal oldConnection, DbConnectionInternal& connection)
   at System.Data.ProviderBase.DbConnectionInternal.TryOpenConnectionInternal(DbConnection outerConnection, DbConnectionFactory connectionFactory, TaskCompletionSource`1 retry, DbConnectionOptions userOptions)
   at System.Data.SqlClient.SqlConnection.TryOpenInner(TaskCompletionSource`1 retry)
   at System.Data.SqlClient.SqlConnection.TryOpen(TaskCompletionSource`1 retry)
   at System.Data.SqlClient.SqlConnection.Open()
   at Dynamicweb.Data.DatabaseConnectionProvider.CreateConnection(Boolean open)
   at Dynamicweb.Data.Database.CreateConnection()
   at Co3.ID.Dw.Services.AreaService.GetAreaCampaignSwatches(Int32 areaId) in C:\Data\Development\git\id-dev\Co3.ID.Dynamicweb\Services\AreaService.cs:line 113
   at CompiledRazorTemplates.Dynamic.RazorEngine_331071da8c5346bf86dc80c7b9fbed79.Execute() in D:\dynamicweb.net\Solutions\id.espresso4.dk-e5\Application\Files\Templates\Designs\identity_v2\_parsed\espresso.parsed.cshtml:line 45
   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()
ClientConnectionId:00000000-0000-0000-0000-000000000000
Error Number:53,State:0,Class:20

1 @inherits Co3.Espresso.Website.TemplateBases.Pages.PageBase 2 @using System.Data 3 @using System.IO 4 @using System.Web 5 @using System.Globalization 6 @using Co3.Espresso.Website.Models.FrontEnd 7 @using Co3.Espresso.Website.Services 8 @using Co3.ID.Dw.Helpers 9 @using Dynamicweb.Frontend 10 @using Dynamicweb.Ecommerce.Common 11 @using Dynamicweb.Environment 12 @using Dynamicweb.Security.UserManagement 13 14 15 16 @{ 17 ShopType shopContext = SiteContext.CurrentSiteContext(); 18 bool isUserAuthenticated = shopContext == ShopType.B2B; 19 string globalAreaLang = PageView.Current().Area.CultureInfo.TwoLetterISOLanguageName; 20 string globalAreaName = PageView.Current().Area.UrlName; 21 22 bool globalPrefix = PageView.Current().Area.UrlIgnoreForChildren; 23 if (globalPrefix == true) 24 { 25 globalAreaName = string.Empty; 26 } 27 CultureInfo currencyCulture = new CultureInfo(Context.Currency.CultureInfo); 28 29 30 string currencySeparatorDecimal = PageView.Current().User != null ? ExecutingContext.GetCulture().NumberFormat.NumberDecimalSeparator : currencyCulture.NumberFormat.NumberDecimalSeparator; 31 string currencySeparatorInteger = PageView.Current().User != null ? ExecutingContext.GetCulture().NumberFormat.NumberGroupSeparator : currencyCulture.NumberFormat.NumberGroupSeparator; 32 33 string openGraphUrl = PageView.Current().SearchFriendlyUrl; 34 string openGraphImage = HttpContext.Current.Request.Url.Scheme + "://" + HttpContext.Current.Request.Url.Host + Espresso.OpenGraphImage; 35 bool loadGoogleTagManager = !string.IsNullOrEmpty(Espresso.Area.GoogleTagManagerID) && 36 !(Espresso.Area.Item.GoogleTagManagerDisableIfPerformanceTestIsDetected == "True" && HttpContext.Current.Request.UserAgent.ToLower().Contains("lighthouse")); 37 38 string espressoCriticalJsFile = HttpContext.Current.Server.MapPath("/Files/Templates/Designs/identity_b2c/_assets/_dist/js/critical.js"); 39 string espressoCriticalJs = File.ReadAllText(espressoCriticalJsFile); 40 41 string espressoCriticalCssFile = HttpContext.Current.Server.MapPath("/Files/Templates/Designs/identity_b2c/_assets/_dist/css/critical.css"); 42 string espressoCriticalCss = File.ReadAllText(espressoCriticalCssFile); 43 44 45 object campaignColors = Co3.ID.Dw.Services.AreaService.Instance.GetAreaCampaignSwatches(PageView.Current().AreaID); 46 } 47 <!DOCTYPE html> 48 <html lang="@globalAreaLang" data-separator-integer="@currencySeparatorInteger" data-separator-decimal="@currencySeparatorDecimal" data-area="@globalAreaName" data-state="@shopContext.ToString()" data-context="id" data-is-b2b="@(shopContext == ShopType.B2B)"> 49 <head> 50 @GetValue("CopyRightNotice") 51 <meta charset="utf-8"> 52 <meta content="width=device-width, initial-scale=1, shrink-to-fit=no, minimal-ui" name="viewport"> 53 <meta content="ie=edge" http-equiv="x-ua-compatible"> 54 <link href="https://cdnjs.cloudflare.com" rel="preconnect"> 55 <link href="https://www.googletagmanager.com" rel="preconnect"> 56 <link href="https://www.google-analytics.com" rel="preconnect"> 57 <link href="https://connect.facebook.net" rel="preconnect"> 58 <title>@GetValue("Title")</title> 59 <style> 60 @espressoCriticalCss 61 </style> 62 @RenderSnippet("webfonts") 63 <link href="/Files/Templates/Designs/identity_v2/_assets/_dist/css/default.css?v=2.18" media="@Espresso.StylesheetAttributeMedia" rel="@Espresso.StylesheetAttributeRel" as="style"> 64 <script> 65 @espressoCriticalJs 66 </script> 67 <script> 68 var campaignColors = @campaignColors; 69 var root = document.querySelector(':root'); 70 Object.keys(campaignColors).forEach(function (swatchKey){ 71 if(swatchKey.indexOf('BrandColor') > -1){ 72 root.style.setProperty(`--campaign-bg-${swatchKey.replace('BrandColor', '')}`, campaignColors[swatchKey]); 73 } else{ 74 root.style.setProperty(`--campaign-text-${swatchKey.replace('NeutralColor', '')}`, campaignColors[swatchKey]); 75 } 76 }); 77 </script> 78 <link rel="shortcut icon" href="@Espresso.Area.Item.Favicon"> 79 <meta name="description" content="@Espresso.DynamicwebPage.Description"> 80 @GetValue("MetaTags") 81 @if (Espresso.IsStagingUrl) 82 { 83 <meta content="noindex,nofollow" name="robots"> 84 } 85 <meta property="og:url" content="@openGraphUrl"> 86 <meta property="og:title" content="@Espresso.OpenGraphTitle"> 87 <meta property="og:description" content="@Espresso.OpenGraphDescription"> 88 <meta property="og:image" content="@openGraphImage"> 89 <meta property="og:type" content="website"> 90 @if (string.IsNullOrEmpty(Espresso.Area.Item.GoogleSiteVerification) == false) 91 { 92 <meta name="google-site-verification" content="@Espresso.Area.Item.GoogleSiteVerification"> 93 } 94 95 <script> 96 window.sleeknoteSiteData || (window.sleeknoteSiteData = []); 97 </script> 98 99 <script> 100 window.dataLayer = window.dataLayer || []; 101 function gtag() { 102 dataLayer.push(arguments); 103 } 104 gtag('consent', 'default', { 105 ad_storage: 'denied', 106 analytics_storage: 'denied', 107 wait_for_update: 500, 108 }); 109 gtag('set', 'ads_data_redaction', true); 110 </script> 111 112 <script id="CookieConsent" src="https://policy.app.cookieinformation.com/uc.js" data-culture="@globalAreaLang" type="text/javascript"></script> 113 @if (loadGoogleTagManager) 114 { 115 <!-- Google Tag Manager --> 116 <script> 117 (function(w, d, s, l, i) { 118 w[l] = w[l] || []; 119 w[l].push({ 120 'gtm.start': 121 new Date().getTime(), 122 event: 'gtm.js' 123 }); 124 125 var f = d.getElementsByTagName(s)[0], 126 j = d.createElement(s), 127 dl = l != 'dataLayer' ? '&l=' + l : ''; 128 j.async = true; 129 j.src = 130 'https://www.googletagmanager.com/gtm.js?id=' + i + dl; 131 f.parentNode.insertBefore(j, f); 132 })(window, document, 'script', 'dataLayer', '@Espresso.Area.GoogleTagManagerID'); 133 </script> 134 <!-- End Google Tag Manager --> 135 } 136 137 <!-- Start of Sleeknote signup and lead generation tool - www.sleeknote.com --> 138 <script id='sleeknoteScript' type='text/javascript'> 139 (function () { var sleeknoteScriptTag = document.createElement('script'); 140 sleeknoteScriptTag.type = 'text/javascript'; 141 sleeknoteScriptTag.charset = 'utf-8'; 142 sleeknoteScriptTag.src = ('//sleeknotecustomerscripts.sleeknote.com/25665.js'); 143 var s = document.getElementById('sleeknoteScript'); 144 s.parentNode.insertBefore(sleeknoteScriptTag, s); 145 })(); 146 </script> 147 <!-- End of Sleeknote signup and lead generation tool - www.sleeknote.com --> 148 149 <script class="usercontext-gtm"> 150 dataLayer.push({ 151 'UserContext': '@shopContext.ToString()', 152 'event': 'UserContext' 153 }); 154 </script> 155 156 157 </head> 158 159 @{ 160 ClassList bodyClasses = new ClassList(); 161 bodyClasses.AddClasses( Espresso.Item.CustomClasses ); 162 163 bodyClasses.AddClasses($"shoptype-{shopContext.ToString()}"); 164 165 } 166 167 <body class="@bodyClasses" data-is-user-authenticated="@isUserAuthenticated.ToString().ToLower()" data-design="@Espresso.Area.DesignsFolderName"> 168 @if (loadGoogleTagManager) 169 { 170 <!-- Google Tag Manager (noscript) --> 171 <noscript> 172 <iframe src="https://www.googletagmanager.com/ns.html?id=@Espresso.Area.GoogleTagManagerID" height="0" width="0" style="display: none; visibility: hidden"></iframe> 173 </noscript> 174 <!-- End Google Tag Manager (noscript) --> 175 } 176 177 @using Co3.Espresso.Website.Models.FrontEnd 178 @using Co3.Espresso.Website.Models.FrontEnd.Settings 179 @using Co3.Espresso.Website.Services 180 @using Dynamicweb.Frontend 181 @inherits Co3.Espresso.Website.TemplateBases.Pages.PageBase 182 @{ 183 Espresso.Canvas.Classes.AddClasses( "js-e-canvas is-loading" ); 184 if ( Espresso.Item.CanvasFullscreen == "True" ) 185 { 186 Espresso.Canvas.Classes.AddClasses( "is-fullscreen" ); 187 } 188 string campaignSplash = Espresso.Area.Item.CampaignSplash; 189 190 string redirect = GetGlobalValue("Global:Pageview.Url.Raw"); 191 HttpCookie userSavedAreaLanguage = HttpContext.Current.Request.Cookies[ "e4.redirect.language" ]; 192 HttpCookie userDisableRedirect = HttpContext.Current.Request.Cookies[ "e4.redirect.disabled" ]; 193 } 194 195 196 197 <div class="e-loading-overlay e-page-loading-overlay is-loading js-e-page-loading-overlay"> 198 @RenderingService.Instance.PartialView( "_partials/loading-spinner.cshtml" ) 199 </div> 200 201 @RenderingService.Instance.PartialView( "_partials/webfonts.cshtml", Espresso ) 202 <div class="@Espresso.Canvas.Classes"> 203 @RenderingService.Instance.PartialView( "_partials/header.cshtml", Espresso ) 204 @RenderingService.Instance.PartialView( "usermanagement/viewprofile/espresso-impersonate-user-msg.cshtml", Espresso ) 205 206 <main id="dwcontentmain" class="e-content js-e-content @Espresso.ContentArea.Classes"> 207 @RenderingService.Instance.PartialView( "_partials/breadcrumb.cshtml", Espresso ) 208 <article class="e-content-article"> 209 @RenderingService.Instance.PartialView( "_partials/nav-local-horizontal.cshtml", Espresso ) 210 @RenderingService.Instance.PartialView( "_partials/nav-local-vertical.cshtml", Espresso ) 211 @RenderingService.Instance.SectionStart( new SectionSettings() ) 212 @GetValue("DwContent(dwcontentmain)") 213 @RenderingService.Instance.SectionEnd() 214 </article> 215 </main> 216 217 @RenderingService.Instance.PartialView( "_partials/footer.cshtml", Espresso ) 218 219 @if ( !string.IsNullOrEmpty( GetString( "DwContent(dwcontentcta)" ) ) ) 220 { 221 <aside class="e-cta fixed-top is-hidden js-e-cta" id="dwcontentcta"> 222 @RenderingService.Instance.SectionStart( new SectionSettings 223 { 224 ContentClasses = new ClassList( "col-12" ), 225 OuterRowClasses = new ClassList("row no-gutters"), 226 InnerRowClasses = new ClassList("row no-gutters justify-content-center align-items-center") 227 } ) 228 @GetValue("DwContent(dwcontentcta)") 229 @RenderingService.Instance.SectionEnd() 230 231 </aside> 232 } 233 234 @RenderingService.Instance.PartialView( "ecom7/cartv2/step/espresso-cart-msg.cshtml" ) 235 </div> 236 237 @RenderingService.Instance.PartialView( "_partials/search.cshtml", Espresso ) 238 239 @RenderingService.Instance.PartialView( "_partials/back-to-top.cshtml", Espresso ) 240 @RenderingService.Instance.PartialView("/Extranet/partials/identity-login.cshtml", Espresso) 241 242 @if (string.IsNullOrEmpty(campaignSplash) == false) 243 { 244 int campaignSplashParagraphId; 245 int.TryParse(campaignSplash, out campaignSplashParagraphId); 246 if (campaignSplashParagraphId > 0) 247 { 248 @RenderParagraphContent(campaignSplashParagraphId); 249 } 250 251 } 252 253 @if ( 1 == 2 ) 254 { 255 @GetValue("DwCookieWarning") 256 } 257 258 @if ( userSavedAreaLanguage == null ) 259 { 260 //@RenderingService.Instance.PartialView( "_partials/redirect.cshtml" ) 261 } 262 else 263 { 264 string currentAreaLanguage = PageView.Current().Area.UrlName; 265 string savedAreaLanguage = userSavedAreaLanguage.Value; 266 bool disabledRedirectForSession = userDisableRedirect != null ? Boolean.Parse( HttpContext.Current.Request.Cookies[ "e4.redirect.disabled" ].Value ) : false; 267 268 if ( currentAreaLanguage != savedAreaLanguage && disabledRedirectForSession == false ) 269 { 270 string redirectUrl = string.Format( "{0}://{1}/{2}", HttpContext.Current.Request.Url.Scheme, HttpContext.Current.Request.Url.Host, savedAreaLanguage); 271 HttpContext.Current.Response.Redirect(redirectUrl); 272 273 } 274 275 } 276 <script async="" src="/Files/Templates/Designs/identity_v2/_assets/_dist/js/default.js?v=2.18.5"></script> 277 </body> 278 279 @GetValue("CopyRightNotice") 280 </html>