keyboard_arrow_up
Error executing template "Designs/ambu/_partials/redirect.cshtml"
System.IO.IOException: The process cannot access the file 'E:\dynamicweb.net\SolutionsCustom\Co3\ambu-com.espresso4.dk\files\Templates\Designs\ambu\Translations.xml' because it is being used by another process.
   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)
   at Dynamicweb.Rendering.Translation.Source.WriteDocument(XmlDocument document)
   at Dynamicweb.Rendering.Translation.Source.Save()
   at Dynamicweb.Rendering.Translation.Source.UpdateTranslationSource(Source source, IEnumerable`1 newKeys, String designName, IEnumerable`1 cultures)
   at Dynamicweb.Rendering.TemplateBase`1.Translate(String text, String defaultValue, String cultureName)
   at CompiledRazorTemplates.Dynamic.RazorEngine_71ee3a15136d49ce8c5b7fef27606890.Execute() in E:\dynamicweb.net\SolutionsCustom\Co3\ambu-com.espresso4.dk\files\Templates\Designs\ambu\_partials\redirect.cshtml:line 12
   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 RazorTemplateBase<RazorTemplateModel<Template>> 2 @using Co3.Dw9.Redirect.Dw.Models 3 @using Co3.Dw9.Redirect.Dw.Services 4 @using Dynamicweb.Configuration 5 @using Dynamicweb.Rendering 6 7 @{ 8 IRedirectResponse redirectInfo = RedirectService.Instance.GetRedirectInfo(); 9 if ( redirectInfo != null && redirectInfo.SuggestRedirect ) 10 { 11 string redirectConsentExpirationTimeInDays = SystemConfiguration.Instance.GetValue( "/Globalsettings/Co3.Espresso/GeoRedirect/CookieExpireTimeInDays" ); 12 string redirectMessage = Translate( "Redirect message - Text", "You are visiting our website in {{CurrentLanguage}}. Would you like to visit the {{SuggestedLanguage}} site?" ); 13 redirectMessage = redirectMessage.Replace( "{{CurrentLanguage}}", redirectInfo.CurrentLanguageName.ToLower() ); 14 redirectMessage = redirectMessage.Replace( "{{SuggestedLanguage}}", redirectInfo.SuggestedLanguageName.ToLower() ); 15 string linkToSuggestedArea = string.Format( "http://{0}", redirectInfo.SuggestedArea.DomainLock ); 16 <div class="fade modal ambu-redirect-modal" id="js-e-redirect-msg" data-redirect-consent-expiration="@redirectConsentExpirationTimeInDays" data-dismiss="modal"> 17 <div class="modal-dialog"> 18 <div class="modal-content"> 19 <div class="modal-body pb-0"> 20 <button class="close" data-dismiss="modal" type="button"> 21 <i class="material-icons">close</i> 22 </button> 23 <h2>@Translate( "Redirect message - Heading", "Welcome" )</h2> 24 <p class="lead"> 25 @redirectMessage 26 </p> 27 <ul> 28 <li> 29 <p> 30 <a href="@linkToSuggestedArea"> 31 <img src="/admin/public/getimage.ashx?Crop=0&Image=/Files/Images/icons/icon-redirect-us-flag.png&Format=jpg&Width=1280&Height=0&Quality=75&donotupscale=true" alt="US flag" /> 32 <br /> 33 @Translate( "Redirect message - ambuusa.com - link text", "ambuusa.com" ) 34 </a> 35 </p> 36 </li> 37 <li> 38 <p> 39 <a href="//www.ambu.com/"> 40 <img src="/admin/public/getimage.ashx?Crop=0&Image=/Files/Images/icons/icon-redirect-global.png&Format=jpg&Width=1280&Height=0&Quality=75&donotupscale=true" alt="Global icon" /> 41 <br /> 42 @Translate( "Redirect message - ambu.com - link text", "ambu.com" ) 43 </a> 44 </p> 45 </li> 46 </ul> 47 </div> 48 </div> 49 </div> 50 </div> 51 } 52 } 53