Registration-free COM deployment

Most of the runtime features that are used by web applications that are running Commerce Server can be run in a registration-free COM deployment.

In some environments, such as Azure Web Apps, it is not possible to run installers, access the registry, or access most of the file system. In those types of environments, you cannot deploy .NET assemblies to the GAC, and cannot use Serviced Components.

Most of the runtime features that are used by web applications that are running Commerce Server can be run in a registration-free COM deployment. In those types of deployments, it is necessary to deploy all of the required Commerce Server binaries into the web application bin directory.

The required binaries are split into five subsystems: Common, Catalog, Orders, Profiles, and Marketing. These required binaries are packaged into five Nuget packages:

  1. Sitecore.Commerce.Assemblies.Common.nupkg

  2. Sitecore.Commerce.Assemblies.Catalog.nupkg

  3. Sitecore.Commerce.Assemblies.Orders.nupkg

  4. Sitecore.Commerce.Assemblies.Profiles.nupkg

  5. Sitecore.Commerce.Assemblies.Marketing.nupkg

Each of the Nuget packages contain the .NET assemblies and native .dlls, content files, MSBuild.targets, and supporting installation scripts to be referenced by developers who are building web applications. For example, adding Sitecore.Commerce.Assemblies.Common.nupkg as a reference to a web application will add all of the .NET references to that project, and copies the native .dlls into the web application bin directory at build time. Adding Sitecore.Commerce.Assemblies.Common.nupkg adds a Sitecore.Commerce.Assemblies.Common.manifest to the web application root, and registers the RegFreeComHelperModule, an HTTP module, to the web.config file:

The developer of the web application needs to update the web.config to include a new appSettings element:

<system.webServer>
    <modules>
      <add name="RegFreeComHelperModule" type="CommerceServer.Core.Runtime.RegFreeComHelperModule, CommerceServer.Core.Runtime,
        Version=10.0.0.0, Culture=neutral, PublicKeyToken=f5c79cb11734af7a" />
...
<system.webServer>

Adding any of the other packages, which are dependent on Sitecore.Commerce.Assemblies.Common.nupkg, will add additional dependencies and manifests to the web application root. The RegFreeComHelperModule merges all of the Sitecore.Commerce.Assemblies.*.manifest files into one webapp.manifest when first loaded.

Configuration requirements:

  1. Update the web.config to configure the administration database. This is because Commerce Server will not be able to access the registry as it normally does in order to discover the administration database connection string.

      
    <connectionStrings>
        <add name="ADMINDBPS" connectionString="<connection_string>" />
    ...
    </connectionStrings>
  2. You must disable shadow copying for registration free COM deployments, otherwise COM will not be able to locate runtime dependencies:

    <system.web>
    ...
    <hostingEnvironment shadowCopyBinAssemblies="false" />
    ...
    <system.web>
  3. The orders subsystem must have transactions disabled: <orders honorStatus="true" newOrderStatus="NewOrder" enableTransactions="false">