Error executing template "Designs/LM2016/_parsed/Frontpage.parsed.cshtml"
System.ArgumentException: Object type cannot be converted to target type.
   at RazorEngine.Compilation.CrossAppDomainCleanUp.CleanupHelper.Init(AppDomain domain, IPrinter printer)
   at RazorEngine.Compilation.CrossAppDomainCleanUp.InitHelper.CreateHelper()
   at RazorEngine.Compilation.ExecutionContextLessThread.CallHelperSafeHelper`2.AsAction()
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
   at RazorEngine.Compilation.ExecutionContextLessThread.DefaultCallFunc[O](Func`1 f)
   at RazorEngine.Compilation.CrossAppDomainCleanUp..ctor(AppDomain toWatch, IPrinter printer)
   at RazorEngine.Compilation.CrossAppDomainCleanUp.CreateInitial()
   at System.Lazy`1.CreateValue()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Lazy`1.get_Value()
   at RazorEngine.Compilation.CrossAppDomainCleanUp.RegisterCleanup(String item, Boolean throwOnDefault)
   at RazorEngine.Templating.InvalidatingCachingProvider.CacheTemplate(ICompiledTemplate template, ITemplateKey templateKey)
   at RazorEngine.Templating.RazorEngineService.CompileAndCacheInternal(ITemplateKey key, Type modelType)
   at RazorEngine.Templating.RazorEngineService.GetCompiledTemplate(ITemplateKey key, Type modelType, Boolean compileOnCacheMiss)
   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 Dynamicweb.Rendering.RazorTemplateBase<Dynamicweb.Rendering.RazorTemplateModel<Dynamicweb.Rendering.Template>> 2 @using System; 3 4 <!DOCTYPE html> 5 <html lang='@GetString("LongLang")'> 6 <head> 7 <meta charset="utf-8"> 8 <title>@GetValue("Title")</title> 9 @GetValue("MetaTags") 10 @GetValue("CopyRightNotice") 11 12 @inherits Dynamicweb.Rendering.RazorTemplateBase<Dynamicweb.Rendering.RazorTemplateModel<Dynamicweb.Rendering.Template>> 13 @using System; 14 @using Dynamicweb.Frontend; 15 16 <meta name="viewport" content="width=device-width, initial-scale=1.0"> 17 18 <meta name="author" content=""> 19 @foreach (var language in GetLoop("Languages").Where(l => (l.GetString("Culture") != "ru-RU" && !string.IsNullOrEmpty(l.GetString("PageID"))@*&& !l.GetBoolean("PageIsHidden")*@))) { 20 string lang = language.GetString("Culture").Substring(3) == "US" ? language.GetString("Culture") : language.GetString("Culture").Substring(0, 2); 21 string link = "https://" + language.GetString("PrimaryDomain") + SearchEngineFriendlyURLs.GetFriendlyUrl(language.GetInteger("PageID")); 22 <link rel="alternate" hreflang='@lang' href='@link'> 23 } 24 25 @RenderSnippet("StyleSheet") 26 27 @{ 28 string favicon = Convert.ToString(Pageview.Area.Item["Favicon"]); 29 string faviconUrl = GetString("Template:DesignBaseUrl") + "assets/images/" + favicon; 30 string customCSS = Convert.ToString(Pageview.Area.Item["Custom_CSS_Url"]); 31 string customCssUrl = "assets/stylesheets" + customCSS; 32 if (!string.IsNullOrEmpty(customCSS)) { 33 <link href="@customCssUrl" rel="stylesheet" media="screen"> 34 } 35 if (!string.IsNullOrEmpty(favicon)) { 36 <link rel="icon" type="image/png" href="@faviconUrl"> 37 } 38 } 39 40 @RenderSnippet("JavaScriptHead") 41 42 <link href="/Files/Templates/Designs/LM2016/assets/stylesheets/screen.css" rel="stylesheet" media="screen"> 43 <link href='//fonts.googleapis.com/css?family=Open+Sans:300italic,400italic,600italic,700italic,800italic,400,300,600,700,800|Open+Sans+Condensed:300,300italic,700' rel='stylesheet' type='text/css'> 44 45 <script type="text/javascript" src="https://secure.leadforensics.com/js/59050.js"></script> 46 <noscript><img alt="" src="https://secure.leadforensics.com/59050.png" style="display:none;"></noscript> 47 48 @if (!string.IsNullOrEmpty(Convert.ToString(Pageview.Area.Item["Google_Analytics_ID"])) ) { 49 <script> 50 var setCookie = ("@Dynamicweb.Environment.CookieManager.GetCookieOptInLevel().ToString()" != "All") ? true : false; 51 window['ga-disable-@Pageview.Area.Item["Google_Analytics_ID"]'] = setCookie; 52 (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){ 53 (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), 54 m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) 55 })(window, document, 'script', '//www.google-analytics.com/analytics.js', 'ga'); 56 57 ga('create', '@Pageview.Area.Item["Google_Analytics_ID"]', '@GetGlobalValue("Global:Area.Primarydomain")'); 58 ga('require', 'displayfeatures'); 59 ga('send', 'pageview'); 60 </script> 61 } 62 63 @GetValue("Stylesheets") 64 @GetValue("Javascripts") 65 </head> 66 @{ 67 string firstActive = GetString("DwAreaFirstActivePageID"); 68 bool isMobile = Pageview.Device.ToString() == "Mobile"; 69 } 70 <body data-pageid='@Pageview.Page.ID' class='@GetGlobalValue("Global:Area.Name")'> 71 @if (isMobile) { 72 <text> 73 @inherits Dynamicweb.Rendering.RazorTemplateBase<Dynamicweb.Rendering.RazorTemplateModel<Dynamicweb.Rendering.Template>> 74 @using Dynamicweb.Rendering; 75 76 <div id="pushobj"> 77 <a type="button" class="btn btn-default" id="toggle" href="#phoneMenu"> 78 Menu 79 <i class="fa fa-reorder"></i> 80 </a> 81 </div> 82 <nav id="phoneMenu"> 83 <ul> 84 <li> 85 @GetValue("DwNavigation(navPhoneMain)") 86 </li> 87 <li> 88 <h6>@Translate("contactDownload", "Contact & Download")</h6> 89 @GetValue("DwNavigation(navPhoneTop)") 90 </li> 91 <li> 92 <h6>@Translate("languages", "Languages")</h6> 93 </li> 94 @inherits Dynamicweb.Rendering.RazorTemplateBase<Dynamicweb.Rendering.RazorTemplateModel<Dynamicweb.Rendering.Template>> 95 96 @foreach (var language in GetLoop("Languages").Where(l => l.GetString("Culture")!="ru-RU")) { 97 string culture = language.GetString("Culture"); 98 if (!language.GetBoolean("IsCurrent")) { 99 string languagePage = (!string.IsNullOrEmpty(language.GetString("PageID")) && !language.GetBoolean("PageIsHidden")) ? language.GetString("PageID") : language.GetString("FirstPageID"); 100 <li class="flags @culture.Substring(3).ToLower()"><a href="/Default.aspx?ID=@languagePage" hreflang="@culture.Substring(0, 2)">@language.GetString("Name")</a></li> 101 } else { 102 <li class="flags @culture.Substring(3).ToLower() active">@language.GetString("Name")</li> 103 } 104 } 105 106 </ul> 107 </nav> 108 109 </text> 110 } else { 111 <section class="topmenu-wrapper"> 112 <div class="container"> 113 <div class="topmenu"> 114 @inherits Dynamicweb.Rendering.RazorTemplateBase<Dynamicweb.Rendering.RazorTemplateModel<Dynamicweb.Rendering.Template>> 115 @using Dynamicweb.Rendering; 116 117 <nav class="navbar hidden-print" data-equable="true" role="navigation"> 118 <button type="button" class="btn btn-default navbar-toggle" data-toggle="collapse" data-target="#topnav"> 119 <span class="icon-bar"></span> 120 <span class="icon-bar"></span> 121 <span class="icon-bar"></span> 122 </button> 123 <div class="collapse navbar-collapse" id="topnav"> 124 <ul class="nav lang-selector"> 125 @inherits Dynamicweb.Rendering.RazorTemplateBase<Dynamicweb.Rendering.RazorTemplateModel<Dynamicweb.Rendering.Template>> 126 127 @foreach (var language in GetLoop("Languages").Where(l => l.GetString("Culture")!="ru-RU")) { 128 string culture = language.GetString("Culture"); 129 if (!language.GetBoolean("IsCurrent")) { 130 string languagePage = (!string.IsNullOrEmpty(language.GetString("PageID")) && !language.GetBoolean("PageIsHidden")) ? language.GetString("PageID") : language.GetString("FirstPageID"); 131 <li class="flags @culture.Substring(3).ToLower()"><a href="/Default.aspx?ID=@languagePage" hreflang="@culture.Substring(0, 2)">@language.GetString("Name")</a></li> 132 } else { 133 <li class="flags @culture.Substring(3).ToLower() active">@language.GetString("Name")</li> 134 } 135 } 136 137 </ul> 138 <ul class="nav"> 139 @if (!string.IsNullOrEmpty(GetString("DW_extranet_AccessUserID"))) { 140 <li> 141 <a href='Default.aspx?ID=@GetString("DwPageID")'> 142 Logged in as 143 '@GetString("DW_extranet_AccessUserName")' 144 </a> 145 </li> 146 <li> 147 <a href='/Admin/Public/extranetlogoff.aspx?ID=@GetString("DwPageID")'>Log out</a> 148 </li> 149 } else { 150 <li><a href="javascript:void(0);" data-toggle="modal" data-target="#login">Log in</a></li> 151 } 152 </ul> 153 @GetValue("DwNavigation(navTop)") 154 </div> 155 156 </nav> 157 158 </div> 159 </div> 160 </section> 161 } 162 <header class="header-wrapper" data-spy="affix" data-offset-top="65"> 163 <div class="container"> 164 <div class="logo-wrapper"> 165 <div class="logo"> 166 <a href='/Default.aspx?ID=@firstActive' class="logo-image"></a> 167 </div> 168 <div class="search-box"> 169 @inherits Dynamicweb.Rendering.RazorTemplateBase<Dynamicweb.Rendering.RazorTemplateModel<Dynamicweb.Rendering.Template>> 170 <form method="get" action="/Default.aspx" class="form-search"> 171 <input type="hidden" name="ID" value='@GetString("DwAreaSearchPageID")'> 172 <div class="input-group"> 173 <input class="form-control" type="search" name="q"> 174 <span class="input-group-btn"> 175 <button type="submit" value="Search" class="btn"><span class="fa fa-search icon-wht"></span></button> 176 </span> 177 </div> 178 </form> 179 180 </div> 181 @if (!isMobile) { 182 <div class="mainmenu"> 183 <nav class="navbar wrappable" data-equable="true" role="navigation"> 184 <button type="button" class="btn btn-default navbar-toggle" data-toggle="collapse" data-target="#mainnav"> 185 <span class="icon-bar"></span> 186 <span class="icon-bar"></span> 187 <span class="icon-bar"></span> 188 </button> 189 <div class="collapse navbar-collapse" id="mainnav"> 190 @GetValue("DwNavigation(NavMain)") 191 </div> 192 </nav> 193 </div> 194 } 195 </div> 196 </div> 197 </header> 198 @inherits Dynamicweb.Rendering.RazorTemplateBase<Dynamicweb.Rendering.RazorTemplateModel<Dynamicweb.Rendering.Template>> 199 200 201 202 203 204 205 <section class="feature-slider-wrapper"> 206 <div id="featureCarousel" class="carousel slide nospacing frontpage-slider" data-ride="carousel" data-carousel-map="#frontpageSliderMap"> 207 <div class="carousel-inner container" id="sliderInnerWrapper">@GetValue("DwContent(sliderInnerWrapper)")</div> 208 <a class="carousel-control left" href="#featureCarousel" role="button" data-slide="prev"><span class="fa fa-chevron-left"></span></a> 209 <a class="carousel-control right" href="#featureCarousel" role="button" data-slide="next"><span class="fa fa-chevron-right"></span></a> 210 </div> 211 <div class="container"> 212 <div class="row nospacing frontpage-slider-map" id="frontpageSliderMap"> 213 <!-- Slider items map --> 214 </div> 215 </div> 216 </section> 217 218 <section class="page-wrapper"> 219 <section class="container content-wrapper frontpage"> 220 <div class="row frontpage-content-main content-main" id="content-main">@GetValue("DwContent(contentmain)")</div> 221 </section> 222 </section> 223 224 <footer class="footer-wrapper"> 225 <section class="container"> 226 <div id="footerSections" title="Footer sections"> 227 @RenderPageContent(Convert.ToInt32(Pageview.Area.Item["Footer_Content_Page_ID"])) 228 </div> 229 </section> 230 </footer> 231 232 @*@RenderPageContent(Convert.ToInt32(Pageview.Area.Item["EmailSignupPageId"]))*@ 233 234 <script src="/Files/Templates/Designs/LM2016/assets/vendor/require.min.js"></script> 235 <script src="/Files/Templates/Designs/LM2016/assets/vendor/dynamicweb.start.min.js"></script> 236 @RenderSnippet("JavaScriptBottom") 237 <div class="modal fade" id="login" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true"> 238 <div class="modal-dialog modal-sm"> 239 <div class="modal-content"> 240 <div class="modal-header"> 241 <h4 class="modal-title" id="myModalLabel">@Translate("Login", "Login")</h4> 242 </div> 243 <form role="form" id="loginform" method="post"> 244 <div class="modal-body"> 245 @if (!string.IsNullOrWhiteSpace(GetString("DW_extranet_error_uk"))) { 246 <script>alert("@GetValue("DW_extranet_error_uk")");</script> 247 } 248 <input type="hidden" name="ID" value="@Pageview.Page.ID"> 249 <input type="hidden" name="DWExtranetUsernameRemember" value="True"> 250 <input type="hidden" name="DWExtranetPasswordRemember" value="True"> 251 <div class="form-group"> 252 <label for="username">@Translate("Email address", "Email address")</label> 253 <input type="text" class="form-control" name="username" id="username" placeholder='@Translate("Enter username", "Enter username")' value='@GetValue("DWExtranetUsername")' style="width: 100% !important;"> 254 </div> 255 <div class="form-group" style="padding-top: 10px"> 256 <label for="password">@Translate("Password", "Password")</label> 257 <input type="password" class="form-control" name="password" id="password" placeholder='@Translate("Enter password", "Enter password")' style="width: 100% !important;"> 258 <p>&nbsp;</p> 259 <a class="pull-left" href='/Default.aspx?ID=@GetString("DwAreaFirstActivePageID")&LoginAction=Recovery'>@Translate("Forgot your password?", "Forgot your password?")</a> 260 <text>&nbsp;</text> 261 </div> 262 </div> 263 <div class="modal-footer"> 264 <div class="checkbox pull-left" style="margin-top: 0 !important"> 265 <label> 266 <input type="checkbox" name="Autologin" checked="checked" value="True"> @Translate("Remember me", "Remember me") 267 </label> 268 </div> 269 <button type="submit" class="btn btn-xs pull-right">@Translate("Sign in", "Sign in")</button> 270 </div> 271 </form> 272 </div> 273 </div> 274 </div> 275 </body> 276 </html> 277