HomeDev GuideAPI Reference
Dev GuideAPI ReferenceUser GuideGitHubNuGetDev CommunitySubmit a ticketLog In
GitHubNuGetDev CommunitySubmit a ticket

Install apps

Describes how to install, update and disable apps (add-ons).

Optimizely uses NuGet to handle applications (apps, also known as add-ons) in a standard package format. You can install apps directly from Visual Studio or through the app's user interface.

📘

Note

For Azure environments, install app modules only through Visual Studio (and not from the Optimizely apps interface).

Configure installation options

Configure your choice of installation approach in the configuration file as described below.

<episerver.packaging installationMode="MODE">

Values for installationMode are Code or UI. You should install, upgrade, manage, and uninstall apps from Visual Studio or the user interface, but not both, because an app may not work as expected. For example, if you install an app from Visual Studio, it displays in the app user interface, but operations (like disable and uninstall) may be unavailable.

Before installing apps from Visual Studio

  1. Set <episerver.packaging installationMode="Code">

    📘

    Note

    If installationMode was set to UI, run the cmdlet Convert-EPiAddons in the Package Manager Console. This converts existing apps installed with the user interface to Visual Studio format.

  2. Add https://nuget.episerver.com/feed/packages.svc/ as a NuGet source.
  3. Install and upgrade apps as normal through Visual Studio.

Repository.config

The modules/_protected folder contains a repository.config file, which is created during app system initialization. If the server is hardened, IIS does not have write access to the _protected folder and the site does not launch (you get an access denied message). To resolve the problem, give IIS_IUSRS modify rights to the _protected folder.

Each web server in a load-balanced environment has a repository.config file. The file contains a unique repository GUID. The app system allows for the execution of custom code when you install, update, or are about to uninstall an app. The app system uses the GUID to verify that the custom code is executed on all servers. When deploying multiple sites, it is a good idea to copy a generated repository.config file (per machine) as part of the deployment.

Because each server's repository.config file has a unique GUID, so do not commit the file to the source.

Before installing apps from the UI

You can install apps from the app's user interface without access to Visual Studio. To install app packages, you must be a member of the PackagingAdmins user group and have access to the Optimizely user interface.

  • Set <episerver.packaging installationMode="UI">

Install app packages from the Optimizely central repository

In Optimizely, select Add-ons (apps) in the global menu. From here, you can install any available app. Optimizely does the following:

  1. Optimizely adds packages to a temporary repository.
  2. Optimizely tries to resolve dependents and dependencies and installs the packages for the application from the temporary repository combined with the other repositories.
  3. Optimizely validates uploaded files and selected apps if they are valid NuGet packages marked with proper module tags: EPiServerModulePackage or EPiServerPublicModulePackage.
  4. After installing a package to the repository, you can instantiate it to any number of applications.

Change the location of the temporary repository

The following list shows the package source repositories:

  • Optimizely central repository
  • The temporary repository
  • The site local repository

Optimizely uses the temporary repository in conjunction with the virtual packages to resolve dependencies before installation, representing available assemblies on the site and the local repository. By default, the operating system designates the location of the temporary repository directory. To change the directory, change the value of the packagesTemporaryFolder attribute in the episerver.packaging element.

<episerver.packaging packagesTemporaryFolder="...">

Change the location of the local repository

Optimizely sets up the site directory, C:\\EPiServer\&lt;SiteName>\\wwwroot\\modules, with correct access rights when you install Optimizely Framework from the Optimizely Deployment Center. Optimizely adds installed packages to the site local repository. To change the directory, set
<episerver.packaging repositoryPath="C:\EPiServer\Sites\MySite\App_Data\Packages">

📘

Note

Make sure that the web application has write access rights for the specified directory.

Add repositories to the configuration

You can add repositories to the configuration, as shown in the following example:

<episerver.packaging>
  <packageRepositories>
     <add name="Gallery" url="\\server\Your\Packages\Folder" />
  </packageRepositories>
</episerver.packaging>

📘

Note

Installed apps are registered in the file in the site root. Optimizely copies supported files to the corresponding app folder in the ~/modules/ directory. See the description for the episerver.packaging element in episerver.packaging (Legacy).

Copy app assemblies to the probing path directory

Optimizely copies app assemblies compatible with the current framework version to the probing path directory, which is in dirmodulesbin under C:\\EPiServer\<SiteName>\wwwroot\*. The probing path directory must be available at this location, and you define it in the probingPath attribute in the _configuration/episerver.framework/scanAssembly* element. You should configure the same path in the privatePath attribute of probing element:

EPiServerFramework.config

<episerver.framework>
  <scanAssembly forceBinFolderScan="true" probingPath="modulesbin" />

web.config

<runtime>
  <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
     <probing privatePath="modulesbin" />

Complete the installation

After you install app packages, installation results display information about whether you need to restart the site (if ASP.NET does not automatically restart it). Site restart is required to load and scan assemblies and initialize installed apps.

Update an app

The Updates tab shows available updates for installed apps. When you upgrade an app, it uninstalls the old version and installs the new one. The update process also updates related apps (dependencies and dependents).

Disable an app

After an upgrade, some apps may become incompatible, and the site might not start. You can disable installed apps from the user interface so they do not block the user interface. Disable an app (such as EPiServer.Cms.AddOns.Blocks in the following example) in the site's configuration file:

<episerver.framework>
  <scanAssembly>
    <add assembly="*" />
    <remove assembly="EPiServer.Cms.AddOns.Blocks" />
  </scanAssembly>
  <!-- other settings -->
</episerver.framework>

Uninstall an app

The Installed tab shows installed apps. You can uninstall apps from here, except for system apps (such as the app management system, which cannot be uninstalled; only upgraded). Optimizely removes app files and the corresponding Shell module folder during uninstallation and deletes assemblies from the probing path directory. Optimizely restarts the site to complete the uninstallation procedure and unload app assemblies from the application domain.