Exception in template (Designs\rotek\QueryPublisher/espresso-dealersearch.cshtml): System.IO.FileNotFoundException: Could not find file 'C:\Windows\ServiceProfiles\NetworkService\AppData\Local\Temp\pczafzri.dll'.
File name: 'C:\Windows\ServiceProfiles\NetworkService\AppData\Local\Temp\pczafzri.dll'
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.File.InternalReadAllBytes(String path, Boolean checkHost)
at Microsoft.CSharp.CSharpCodeGenerator.FromFileBatch(CompilerParameters options, String[] fileNames)
at Microsoft.CSharp.CSharpCodeGenerator.FromDomBatch(CompilerParameters options, CodeCompileUnit[] ea)
at Microsoft.CSharp.CSharpCodeGenerator.System.CodeDom.Compiler.ICodeCompiler.CompileAssemblyFromDomBatch(CompilerParameters options, CodeCompileUnit[] ea)
at RazorEngine.Compilation.DirectCompilerServiceBase.Compile(TypeContext context)
at RazorEngine.Compilation.DirectCompilerServiceBase.CompileType(TypeContext context)
at RazorEngine.Templating.TemplateService.CreateTemplateType(String razorTemplate, Type modelType)
at RazorEngine.Templating.TemplateService.GetTemplate[T](String razorTemplate, Object model, String cacheName)
at RazorEngine.Templating.TemplateService.GetTemplate(String razorTemplate, Object model, String cacheName)
at RazorEngine.Templating.TemplateService.Parse(String razorTemplate, Object model, DynamicViewBag viewBag, String cacheName)
at RazorEngine.Razor.Parse[T](String razorTemplate, T model, String cacheName)
at Dynamicweb.Rendering.Template.RenderRazorTemplate()
@using System.Web; @using System.Linq; @using System.Web.Script.Serialization; @using Dynamicweb.Frontend; @using Dynamicweb.Core.Encoders; @using Dynamicweb.Ecommerce; @using Dynamicweb.Ecommerce.International; @using Co3.Espresso.Base.Extensions; @using Co3.Espresso.Website.Services; @using Co3.Espresso.Website.Models.XML; @inherits Co3.Espresso.Website.TemplateBases.Paragraphs.ParagraphBase@using System.Globalization; @using System.Text.RegularExpressions; @using Dynamicweb.Ecommerce.Common; @using Co3.Espresso.Website.Services; @functions { CultureInfo AreaCultureInfo = Dynamicweb.Frontend.PageView.Current().Area.CultureInfo; public string getProductLink( string groupID, string productID, string variantID = "" ) { string result = string.Empty; string displayPage = ProductService.Instance.GetGroupDisplayPage( groupID ); if( string.IsNullOrEmpty( displayPage ) == false ) { if( string.IsNullOrEmpty( variantID ) == false ) { result = "{0}&ProductID={1}&variantID={2}"; result = string.Format( result, displayPage, productID, variantID ); } else { result = "{0}&ProductID={1}"; result = string.Format( result, displayPage, productID ); } } return result; } public bool isProductGroupPublishedOnWebsite( string groupID ) { bool result = false; string displayPage = ProductService.Instance.GetGroupDisplayPage( groupID ); if( string.IsNullOrEmpty( displayPage ) == false ) { result = true; } return result; } public string getNewsLink( string categoryName, string newsID ) { string result = NewsService.Instance.GetNewsDisplayPage( categoryName, newsID ); string displayPage = NewsService.Instance.GetNewsDisplayPage( categoryName, newsID ); if( string.IsNullOrEmpty( displayPage ) == false ) { result = "/" + displayPage.Replace( "Id", "ID" ).Replace( "#", "&PID=" ) + "&M=NewsV2&Action=1&NewsID=" + newsID; //result = SearchEngineFriendlyURLs.GetFriendlyUrl( result ); } return result; } public string getImageURL( string url, int width = 2560, int height = 0, int crop = 0, int quality = 75, string format = "jpg" ) { string result = string.Empty; if( string.IsNullOrEmpty( url ) == false ) { result = "/admin/public/getimage.ashx?Image={0}&Width={1}&Height={2}&Format={3}&Quality={4}&Crop={5}"; result = string.Format( result, url, width, height, format, quality, crop ); } return result; } public string getPriceFormatted( double price ) { string result = string.Empty; if ( Context.Currency.SymbolPlace == 0 ) { result += string.Format( "<span class=\"e-product-price-currency e-product-price-currency-symbol\">{1}</span>&nbsp;", Context.Currency.Symbol ); } result += string.Format( "<span class=\"e-product-price-price\">{0}</span>", Context.Currency.Format(price, false) ); if ( Context.Currency.SymbolPlace != 0 ) { result += string.Format( "&nbsp;<span class=\"e-product-price-currency e-product-price-currency-code\">{0}</span>", Context.Currency.Code ); } return result; } public string getShortDate( DateTime date ) { string result = string.Empty; result = date.Date.ToString( AreaCultureInfo.DateTimeFormat.ShortDatePattern ).Replace( "-" , "." ); return result; } public string getLongDate( DateTime date ) { string result = string.Empty; result = date.Date.ToString( AreaCultureInfo.DateTimeFormat.LongDatePattern ); return result; } } @{Dictionary<string, Territory> globalCountryMap = TranslationService.Instance.GetCountries();Dictionary<string, Territory> dealersearchCountryMap = new Dictionary<string, Territory>();string CountryCode = Espresso.Page.Area.EcomCountryCode;string UnitSystem = Espresso.Page.Area.Item.GetValue<string>("UnitSystem") ?? string.Empty;string DistanceUnit = UnitSystem == "imperial" ? Translate("Dealersearch - Distance unit metric - Text", "km") : Translate("Dealersearch - Distance unit imperial - Text", "mi");string userID = HttpContext.Current.Request["userid"] ?? string.Empty;string searchQuery = HttpContext.Current.Request["q"] ?? string.Empty;dynamic JSON = new {q = searchQuery.Trim(),userId = userID,users = new List<dynamic>()};foreach ( LoopItem result in GetLoop("QueryResultItem") ) {if( result.GetString( "Active" ) == "True" ) {int id = result.GetInteger( "UserID" );string name = result.GetString( "Name" );string user = result.GetString( "UserName" );string groupnames = result.GetString( "GroupNames" );string lat = result.GetString( "Lat" );string lng = result.GetString( "Lng" );string phone = result.GetString( "Phone" );string mail = result.GetString( "Email" );string website = result.GetString( "Website" );string company = result.GetString( "Company" );string department = result.GetString( "Department" );string address = result.GetString( "Address" );string address2 = result.GetString( "Address2" );string zip = result.GetString( "Zip" );string city = result.GetString( "City" );string country = result.GetString( "Country" );string countrycode = result.GetString( "CountryCode" );JSON.users.Add( new {id = id,name = name,lat = lat,lng = lng,address = address,address2 = address2,zip = zip,city = city,country = country,countrycode = countrycode,phone = phone,mail = mail,website = website} );if( dealersearchCountryMap.ContainsKey( countrycode ) == false && string.IsNullOrEmpty( countrycode ) == false && globalCountryMap.ContainsKey( countrycode ) == true ) {dealersearchCountryMap[ countrycode ] = globalCountryMap[ countrycode ];if( countrycode == Espresso.Page.Area.EcomCountryCode ) {CountryCode = countrycode;}}}}List<Territory> dealersearchCountryList = dealersearchCountryMap.Values.OrderBy( t => t.Name ).ToList();if( string.IsNullOrEmpty( CountryCode ) == true && dealersearchCountryList.Any() == true ) {CountryCode = dealersearchCountryList.First().Code;}else{CountryCode = Espresso.Page.Area.EcomCountryCode;} }<div class="js-e-dealersearch" data-id="@Espresso.Id" data-countrycode="@CountryCode" data-googlemapsapikey="@(Espresso.Page.Area.Item.GetValue<string>("GoogleMapsAPIkey"))" data-unitsystem="@UnitSystem"><div class="row no-gutters"><div class="col-12 col-md-4"><div class="e-dealersearch-sidebar d-flex flex-column"><div class="e-dealersearch-header"><form action="" class="e-dealersearch-form js-e-dealersearch-form small pt-2 pr-2 pl-2"><p class="lead small mb-1 d-none">@Translate("Dealersearch - Heading", "Find an Authorized Dealer")</p><div class="e-dealersearch-input-group mb-1"><div class="row no-gutters align-items-center">@if( dealersearchCountryMap.Count > 1 ) {<div class="col-12 mb-1"><label class="form-control-label" for="">@Translate("Dealersearch - Country selector - Label", "Country")</label><select class="custom-select w-100 js-e-dealersearch-country" name="country">@foreach( Territory country in dealersearchCountryList ) {if( country.Code == CountryCode ) {<option value="@country.Code" selected>@country.Name</option>}else {<option value="@country.Code">@country.Name</option>}}</select></div>}<div class="col-12 mb-1"><label class="form-control-label" for="">@Translate("Dealersearch - Search field - Label", "Street, city or postal code")</label><input type="text" class="js-e-dealersearch-input e-dealersearch-input form-control form-control-lg" name="q" placeholder="" autocomplete="off"><p class="js-e-dealersearch-input-placeholder e-dealersearch-input-placeholder m-0"><i class="material-icons mr-1">my_location</i>@Translate("Dealersearch - Your location - Text", "My location")</p></div><div class="col-12 mb-1"><button class="js-e-dealersearch-submit btn btn-primary btn-block px-0" type="button">@Translate("Dealersearch - Seacrh - Button", "Search")</button></div><script id="js-e-handlebars-tmpl-typeahead-pending" type="text/x-handlebars-template"><div class="js-e-dealersearch-geolocate js-e-dealersearch-suggestions-item e-dealersearch-suggestions-item-geolocation dropdown-item tt-selectable"><i class="material-icons material-icons-large mr-1">my_location</i>@Translate("Dealersearch - Your location - Text", "My location")</div></script><script id="js-e-handlebars-tmpl-typeahead-footer" type="text/x-handlebars-template">{{#if suggestions.length}}<div class="dropdown-divider"></div>{{/if}}<div class="js-e-dealersearch-geolocate js-e-dealersearch-suggestions-item e-dealersearch-suggestions-item-geolocation dropdown-item tt-selectable"><i class="material-icons material-icons-large mr-1">my_location</i>@Translate("Dealersearch - Your location - Text", "My location")</div></script></div></div></form></div><div class="e-dealersearch-main d-flex flex-column h-100"><div class="e-dealersearch-list js-e-dealersearch-list d-flex flex-column small h-100 pt-2 is-empty"><script id="js-e-handlebars-tmpl-marker-list" type="text/x-handlebars-template"><div class="mb-1 mr-2 pb-1 ml-2 d-md-none"><p class="mb-0"><a href="#" class="js-e-dealersearch-show-map arrow-down">Show map</a></p></div>{{#loop markers}}<div class="mb-1 mr-2 pb-1 ml-2 js-e-dealersearch-list-item e-dealersearch-list-item" data-id="{{id}}"><div class="row no-gutters align-items-center"><div class="col-6 col-md-9"><div class="e-dealersearch-list-item-address small"><h3 class="mb-0">{{name}}</h3><p class="mb-0">{{address}}</p><p class="mb-0">{{zip}} {{city}}</p>{{#if phone}}<p class="mb-0 d-none d-md-block"><a href="tel:{{{phone}}}">{{phone}}</a></p>{{/if}}{{#if mail}}<p class="mb-0"><a href="mailto:{{{mail}}}">{{mail}}</a></p>{{/if}}{{#if website}}<p class="mb-0"><a href="{{{website}}}">{{website}}</a></p>{{/if}}</div></div><div class="col-3 d-md-none text-center">{{#if phone}}<a href="tel:{{{phone}}}" class="e-dealersearch-list-item-phone text-decoration-none"><i class="material-icons material-icons-2x d-block">phone</i><small>{{#if phone}}{{phone}}{{else}}&nbsp;{{/if}}</small></a>{{/if}}</div><div class="col-3 col-md-3 text-center"><a href="https://www.google.dk/maps/dir/''/{{name}},{{address}},{{zip}} {{city}}/" target="_blank" class="e-dealersearch-list-item-drive text-decoration-none"><i class="material-icons material-icons-2x d-block">drive_eta</i><small>{{#if distanceToAddress}} {{distanceToAddress}}&nbsp;@DistanceUnit{{else}}@Translate("Dealersearch - Get directions - Text", "Directions"){{/if}}</small></a></div></div></div>{{/loop}}</script></div></div></div></div><div class="col-12 col-md-8"><div class="e-dealersearch-googlemap-container js-e-dealersearch-googlemap-container"><div class="e-dealersearch-googlemap js-e-dealersearch-googlemap"><script>var e4 = e4 || {};e4.data = e4.data || {};e4.data.dealersearch = e4.data.dealersearch || {};e4.data.dealersearch['@Espresso.Id'] = @JsonService.Instance.ToJson(JSON)</script><script id="js-e-handlebars-tmpl-googlemap-infowindow" type="text/x-handlebars-template"><div class="small my-1 e-dealersearch-googlemap-infowindow"><h3 class="mb-0">{{name}}</h3><p class="mb-0">{{address}}</p><p class="mb-0">{{zip}} {{city}}</p><p class="mb-0"><a href="tel:{{{phone}}}">{{phone}}</a></p><p class="mb-0"><a href="mailto:{{{mail}}}">{{mail}}</a></p></div></script></div></div></div></div> </div>
keyboard_arrow_up