Upgrade Optimizely Mail 10 to CMS 11
This topic describes how to install/upgrade an Alloy sample site with Optimizely Mail 8 and Optimizely Content Management System (CMS 11).
Alloy MVC site
- Install CMS 7.5 and Optimizely Mail through the Deployment Center.
- Use Visual Studio to open your recently created website and press Ctrl + Shift + S to save your solution.
- Change the project target framework to 4.6.1.
- Install:
EPiServer.CMS.UI
EPiServer.CMS.Core
EPiServer.Framework
EPiServer.ServiceLocation.StructureMap
EPiServer.XForms
- If you have installed Search on your site, install
EPiServer.Search
andEPiServer.Search.CMS
- Remove the solution references to
EPiServer.BaseLibrary
andEPiServer.Implementation
. - Delete the following DLLs in the
bin
folder:EPiServer.BaseLibrary.dll
EPiServer.Implementation.dll
EPiServer.WorkflowFoundation.dll
- Right-click on your project and select Project properties > Build. Set Treat warnings as error to None.
- Fix the obsoleted or missing functions/APIs.
- In
AlloyContentAreaRenderer.cs
, change:
- In
public AlloyContentAreaRenderer(IContentRenderer contentRenderer, TemplateResolver templateResolver, IContentAreaItemAttributeAssembler attributeAssembler)
: base(contentRenderer, templateResolver, attributeAssembler)
to
public AlloyContentAreaRenderer(IContentRenderer contentRenderer, TemplateResolver templateResolver, IContentAreaItemAttributeAssembler attributeAssembler, IContentRepository contentRepository, IContentAreaLoader contentAreaLoader)
: base(contentRenderer, templateResolver, attributeAssembler, contentRepository, contentAreaLoader)
* In `ContactPage.cs`, change:
\[EmailAddress\]Â to \[Business.EmailAddress\]
* In PropertyStringList:, remove function CreatePropertyControl().
* Download [ClonedContentProvider.cs](/epiui/CMS/Content/contentassets/12869e5429c54816abd285c1c62254c2/clonedcontentprovider.cs,,188093?epieditmode=False) and replace the existing file in your solution with this.
* Download [CategorizableExtensions.cs](/epiui/CMS/Content/contentassets/12869e5429c54816abd285c1c62254c2/categorizableextensions.cs,,188092?epieditmode=False) and replace the existing file in your solution with this.
* Download [DependencyResolverInitialization.cs](/epiui/CMS/Content/contentassets/12869e5429c54816abd285c1c62254c2/dependencyresolverinitialization.cs,,188094?epieditmode=False) and replace the existing file in your solution with this.
* Download [ServiceLocatorDependencyResolver.cs](/epiui/CMS/Content/contentassets/12869e5429c54816abd285c1c62254c2/servicelocatordependencyresolver.cs,,188096?epieditmode=False) and add it to folder Initialization and include it in your project.
- Install
EPiServer.Packaging.UI
. - In the Visual Studio Package Manager Console, run:
Move-EPiServerProtectedModules
- Install
EPiServer.Mail 10.x.x
. - If you have Microsoft.AspNet.Mvc version="5.2.3":
-
- Check
web.config
in Views, and change all version in section group:
sectionGroup name="system.web.webPages.razor"
from Version=2.0.0.0 to Version=3.0.0.0.
Example:
- Check
<sectionGroup name="system.web.webPages.razor" type="System.Web.WebPages.Razor.Configuration.RazorWebSectionGroup, System.Web.WebPages.Razor, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
<section name="host" type="System.Web.WebPages.Razor.Configuration.HostSection, System.Web.WebPages.Razor, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" />
<section name="pages" type="System.Web.WebPages.Razor.Configuration.RazorPagesSection, System.Web.WebPages.Razor, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" />
</sectionGroup>
- If you have Microsoft.AspNet.Mvc version="4.x.x" (Note: from CMS 11, MVC 5 is required!):
- Check theÂ
web.config
of the site, and updatebindingRedirect
ofSystem.Web.Mvc
.
Example, change from:
- Check theÂ
<bindingRedirect oldVersion="0.0.0.0-4.0.0.0" newVersion="4.0.0.0"/>
to
<bindingRedirect oldVersion="0.0.0.0-4.0.0.1" newVersion="4.0.0.0"/>
- In
EPiServerMail\\MasterPages\\Mail.Master
, replace:
<%= Page.DojoConfig(false, true) %>
with<%= Page.ConfigureDojo(false, true, false) %>
. - If you have Search installed, change:
returnSearchSettings.Config.Active;
to returnSearchSettings.Options.Active;
.
Alloy Web Forms site
- Install CMS 7.5 and Optimizely Mail through the Deployment Center.
- Use Visual Studio to open your recently created website and press Ctrl + Shift + S to save your solution.
- Change the project target framework to 4.6.1.
- Install:
EPiServer.CMS.UI
EPiServer.CMS.Core
EPiServer.Framework
EPiServer.ServiceLocation.StructureMap
EPiServer.XForms
- If you installed your site with Search, installÂ
EPiServer.Search
 andÂEPiServer.Search.CMS.
- Remove the solution references to EPiServer.BaseLibrary and EPiServer.Implementation.
- Delete the following DLLs from the
bin
folder:EPiServer.BaseLibrary.dll
EPiServer.Implementation.dll
EPiServer.WorkflowFoundation.dll
- Right-click on your project and select Project properties > Build. Set Treat warnings as error to None.
- Fix the obsoleted or missing functions/APIs:
- In the
PropertyStringList:
, remove the functionCreatePropertyControl()
. - Download the file ClonedContentProvider.cs and replace the existing file in your solution with this.
- Download the file CategorizableExtensions.cs and replace the existing file in your solution with this.
- Download the file PageList.ascx and replace the existing file in your solution with this.
- In the
- Install
EPiServer.Packaging.UI
. - In the Visual Studio Package Manager Console, run:
Move-EPiServerProtectedModules
- Install
EPiServer.Mail 10.x.x
. - Change:
PermanentLinkMapStore to using EPiServer.Web.Internal; return DataFactory.Instance.GetPage(pageLink, languageSelector);
- to
return DataFactory.Instance.GetPage(pageLink, new LoaderOptions { new LanguageLoaderOption { Language = languageSelector.Language } });
- Add:
using EPiServer.Templates.Alloy.Helpers;
to the top of theProductPageTemplate.aspx.cs
fileusing EPiServer.Templates.Alloy.Helpers;
to the top pf theMainNavigation.ascx.cs
file
- Right-click on your project and select Project properties > Build Events. In Post-build event command line, add:
"$(MSBuildBinPath)\\msbuild.exe" "$(ProjectDir)\[MSBuild\]\\Scripts.xml"
"$(MSBuildBinPath)\\msbuild.exe" "$(ProjectDir)\[MSBuild\]\\Stylesheets.xml"
- In
EPiServerMail\\MasterPages\\Mail.Master
, replace:
<%= Page.DojoConfig(false, true) %>
with<%= Page.ConfigureDojo(false, true, false) %>
. - If you have Search installed, change:
return SearchSettings.Config.Active;
toreturn SearchSettings.Options.Active;
.
Troubleshoot
- Check that you have not removedÂ
EPiServer.Mail.Sources.EPiServerCommunitySearch.dll
 from theÂbin
 folder. - You must be a member of one of the MailAdmins, MailEditors, or Administrators groups.
- If your log is not working, search forÂ
ILog
 and change it toÂILogger
, and removeÂusing LogManager = log4net.LogManager;
. Also, change:Logger.DebugFormat
 toÂLogger.Debug
andLogger.ErrorFormat
 toÂLogger.Error
.
Updated 10 months ago