Exception in template (Designs\RizzoDesignFolder\eCom/Productlist/TeachersList.cshtml): System.IO.FileNotFoundException: Could not find file 'C:\Windows\ServiceProfiles\NetworkService\AppData\Local\Temp\ydpfrmw4.dll'.
File name: 'C:\Windows\ServiceProfiles\NetworkService\AppData\Local\Temp\ydpfrmw4.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 System.IO.File.ReadAllBytes(String path)
   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 System.CodeDom.Compiler.CodeDomProvider.CompileAssemblyFromDom(CompilerParameters options, CodeCompileUnit[] compilationUnits)
   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.Output()
@inherits RazorTemplateBase<RazorTemplateModel<Template>> @using Dynamicweb.Rendering; @using Dynamicweb; @using Dynamicweb.Frontend; @using System.Web; @using System.Web.UI; @using System; @using System.IO; @using System.Text; @using System.Collections.Generic; @using System.Text.RegularExpressions; @using System.Globalization; @{ string designName = GetString("Template:DesignBaseUrl").Replace("/Files/Templates/Designs/", "").Replace("/", ""); }@functions{ public static string GetImage(string sourceString, int imageWidth, int imageHeight, int imageWidthTablet = 0, int imageHeightTablet = 0, int imageWidthMobile = 0, int imageHeightMobile = 0, string imageFormat = "jpg", int imageCompression = 0, int imageCrop = 5, string background = "", string designName = "RizzoDesignFolder") { Dynamicweb.Frontend.PageView currentPageview = Dynamicweb.Frontend.PageView.Current(); string currDevice = currentPageview.Device.ToString(), alternativeImage = currentPageview.Area.Item["NoImage"] != null ? currentPageview.Area.Item["NoImage"].ToString() : "/Files/Templates/Designs/"+ designName + "/images/alternativeImage.jpg", widthString = "", heightString = "", getImageFormat = imageFormat != "jpg" ? "&amp;Format=" + imageFormat : "", getImageCompression = imageCompression != 0 ? "&amp;Compression=" + imageCompression : "", bgColor = !string.IsNullOrEmpty(background) ? "&amp;backgroud="+background : ""; int getImageWidth = imageWidth != 0 ? imageWidth : 0, getImageHeight = imageHeight != 0 ? imageHeight : 0; if (currDevice == Dynamicweb.Frontend.PageView.DeviceType.Tablet.ToString()) { getImageWidth = imageWidthTablet != 0 ? imageWidthTablet : getImageWidth; getImageHeight = imageHeightTablet != 0 ? imageHeightTablet : getImageHeight; } else if (currDevice == Dynamicweb.Frontend.PageView.DeviceType.Mobile.ToString()) { getImageWidth = imageWidthMobile != 0 ? imageWidthMobile : getImageWidth; getImageHeight = imageHeightMobile != 0 ? imageHeightMobile : getImageHeight; } if (getImageWidth != 0) { widthString = "&amp;Width=" + getImageWidth; } if (getImageHeight != 0) { heightString = "&amp;Height=" + getImageHeight; } string output = "/Admin/Public/GetImage.ashx?Image=" + sourceString + widthString + heightString + "&amp;altFmImage_path=" + alternativeImage + getImageFormat + getImageCompression + "&amp;Crop=" + imageCrop + bgColor; return output; } } @inherits RazorTemplateBase<RazorTemplateModel<Template>> @using Dynamicweb.Rendering; @functions{ private string GetImagePathUrl(string small, string medium, string large, string pattern) { string imagePath; if (!string.IsNullOrEmpty(small)) imagePath = small; else if (!string.IsNullOrEmpty(medium)) imagePath = medium; else if (!string.IsNullOrEmpty(large)) imagePath = large; else imagePath = pattern; return imagePath; } } @{ Dynamicweb.Content.Items.Item item = Pageview.Area.Item; string filterString = "", url = HttpContext.Current.Request.Url.AbsoluteUri.ToString(); //var prodLoop = GetLoop("Products").ToList().OrderBy(x => x.GetString("Ecom:Product:Field.EfternavnTag.Value.Clean").Replace(" ","") == null).ThenBy(x => x.GetString("Ecom:Product:Field.EfternavnTag.Value.Clean").Replace(" ","")); var prodLoop = GetLoop("Products").ToList().OrderBy(d => d.GetString("Ecom:Product:Field.EfternavnTag.Value.Clean")).ThenBy(d => d.GetString("Ecom:Product:Field.Name.Value.Clean")).ToList(); int totalPagesNum = GetInteger("Ecom:ProductList.TotalPages"), curPage = !string.IsNullOrEmpty(System.Web.HttpContext.Current.Request.Params["PageNum"]) ? Convert.ToInt32(System.Web.HttpContext.Current.Request.Params["PageNum"].ToString()) : 1; bool noResults = false, isLoggedIn = Pageview.User.LoggedIn, isFrontEnd = Dynamicweb.ExecutingContext.IsFrontEnd(); string currentPageId = Pageview.Page.ID.ToString(), imagesFolder = "/Files/Files/" + designName + "/Products/", totalPages = GetString("Ecom:ProductList.TotalPages"), nextPage = GetString("Ecom:ProductList.NextPage"), pagingHref = "", sortBy = !string.IsNullOrEmpty(System.Web.HttpContext.Current.Request.Params["sortby"]) ? System.Web.HttpContext.Current.Request.Params["sortby"] : "", sortOrder = !string.IsNullOrEmpty(System.Web.HttpContext.Current.Request.Params["SortOrder"]) ? System.Web.HttpContext.Current.Request.Params["SortOrder"] : "", qString = !string.IsNullOrEmpty(System.Web.HttpContext.Current.Request.Params["q"]) ? System.Web.HttpContext.Current.Request.Params["q"] : "", dataView = System.Web.HttpContext.Current.Request.Cookies["dataList"] != null ? System.Web.HttpContext.Current.Request.Cookies["dataList"].Value : "", categories = ""; int pagesTotal = GetInteger("Ecom:ProductList.TotalPages"); string pagePrev = GetString("Ecom:ProductList.PrevPage.Clean"), pageNext = GetString("Ecom:ProductList.NextPage.Clean"), pageRequestUrl = Pageview.GlobalTags.GetTagByName("Global:Request.Url").Value.ToString(); } <div class="teachers-container"> <div id="filtersContainer" class="col-xs-12 noPadding"> <form class="filtersForm" action="/Default.aspx" method="get" data-href="/Default.aspx?ID=@Pageview.Page.ID"> <input type="hidden" value="@Pageview.Page.ID" /> <fieldset> <label> <input type="text" id="teacherSearch" name="Teacher" class="teacher-input" placeholder='@Translate("sogefter","sog efter en underviser")' value="" /> </label> </fieldset> </form> </div> <div id="listContainer" class="col-xs-12 noPadding"> @if (prodLoop.Any()) { <ul data-list="@dataView" id="productsList" class="productsList teachersOuter row"> @foreach (LoopItem product in prodLoop) { string productName = product.GetString("Ecom:Product.Name"), productShortDescription = product.GetString("Ecom:Product.ShortDescription"), productLink = product.GetString("Ecom:Product.Link.Clean"), productImage = GetImagePathUrl(product.GetString("Ecom:Product.ImageSmall.Clean"), product.GetString("Ecom:Product.ImageMedium.Clean"), product.GetString("Ecom:Product.ImageLarge.Clean"), "/Files/Images/Underviserbilleder-Danmark/Billede-paa-vej-MAND.png"), productGetImage = GetImage(productImage, 260, 0); <li class="col-xs-12 col-lg-6"> <div class="col-xs-12 noPadding"> <figure class="col-xs-2 noPadding"> <a href="@productLink"> <img src="@productGetImage" alt="@productName" title="@productName" class="img-responsive" /> </a> </figure> <div class="col-xs-10"> <h2> <a itemprop="name" href="@productLink"> @productName </a> </h2> @if (!string.IsNullOrEmpty(productShortDescription)) { <div class="tileHide shortDescription"> <a itemprop="name" href="@productLink"> @Dynamicweb.Base.TeaserString(StripHtml(productShortDescription), 200, "...") </a> </div> } </div> </div> </li> } </ul> if (pagesTotal > 1 && !String.IsNullOrEmpty(pageNext)) { <div class="pagination"> <a id="page-next" class="page-next" href="@pageNext" title="Next" data-numPages="@pagesTotal" >Next</a> </div> } } else { <div class="no-results"> @Translate("noResults","No Results") </div> } </div> </div> <script> $(document).ready(function(){ var el = $("input:text").get(1); el.focus(); }); </script> @SnippetStart("jsOnLoad") ProjectApplication.Ecommerce().Teachers().List().load(); @SnippetEnd("jsOnLoad") @functions { public static string StripHtml(string source) { return Regex.Replace(source, "<.*?>", string.Empty); } }