Managing Add-ons
Outline
- Compatibility shift: CMS 12 + Commerce 14 run on .NET 6 + ASP.NET Core; most CMS 11 add-ons need refactoring.
-
Installation changes: Add-ons installed via NuGet; service registration moved to
Program.cswith ASP.NET Core middleware. - Upgrades: Third-party add-ons may have new versions; custom add-ons likely require full migration.
- Best practices: Minimize customizations, keep dependencies up-to-date, and maintain clear documentation.
This module addresses the critical aspects of managing add-ons within Optimizely CMS 12 and Commerce 14 solutions. The transition to ASP.NET Core significantly impacts add-on compatibility and the installation/upgrade processes. Development teams must understand how to identify compatible add-ons, correctly install and configure them in the new environment, and navigate the complexities of upgrading existing add-ons or custom solutions.
1. Add-on compatibility in an ASP.NET Core environment
The shift to ASP.NET Core means add-ons developed for CMS 11 (ASP.NET Framework) are generally not directly compatible with CMS 12 and Commerce 14. Add-on vendors must often recompile and refactor their add-ons to target .NET 6+ and use ASP.NET Core APIs.
The impact of ASP.NET Core on add-ons ▼
-
Framework mismatch: Add-ons built against
System.Weband .NET Framework cannot run directly. -
API changes: Internal Optimizely APIs have changed; use
Microsoft.Extensions.DependencyInjectionfor services,IApplicationBuilderfor middleware, and modern APIs. - Project structure: UI components and configuration must adapt to the new ASP.NET Core project layout.
Identifying compatible add-ons ▼
- Optimizely Marketplace: The primary source for compatible add-ons; vendors specify supported Optimizely and .NET versions.
- Vendor documentation: Always review installation instructions, compatibility notes, and migration guides before proceeding.
-
NuGet packages: Look for packages targeting .NET 6+ and referencing
EPiServer.CMS.AspNetCore.orEPiServer.Commerce.AspNetCore.namespaces.
2. Installation process for ASP.NET Core add-ons
Installing add-ons in CMS 12/Commerce 14 largely follows standard ASP.NET Core practices via NuGet and startup configuration.
NuGet package installation
Add-ons are installed via the .NET CLI or the Visual Studio NuGet Package Manager UI.
Service registration and configuration
Add-ons typically require service registration and middleware configuration in Program.cs. The example below shows how an add-on registers its services and middleware in the ASP.NET Core startup pipeline.
Database updates: Some add-ons require schema updates, usually handled automatically on startup or via dotnet ef migrations for EF Core-based add-ons.
3. Upgrading existing add-ons
Upgrading add-ons from CMS 11/Commerce 13 to CMS 12/Commerce 14 can be more complex than fresh installs, especially for custom or heavily modified add-ons.
Third-party add-ons ▼
- Check for CMS 12/Commerce 14 versions: Confirm the vendor has published compatible releases before starting.
- Migration guides: Follow vendor-specific migration instructions carefully.
- Replace NuGet packages: Uninstall the old ASP.NET Framework version and install the new ASP.NET Core version.
-
Update configuration: Move settings from
web.configtoappsettings.jsonand update service registration inProgram.cs.
Custom or heavily modified add-ons ▼
Custom add-ons usually require a full migration - treat them as new development rather than a simple package update.
- Project conversion: Convert the project file to SDK-style format.
-
Target framework: Update to .NET 6+ (e.g.,
net8.0). -
API refactoring: Use ASP.NET Core APIs, refactor
IInitializableModulecode, service registration, and UI components. - Dependency updates: Update all NuGet dependencies to ASP.NET Core-compatible versions.
- Testing: Test thoroughly both in isolation and integrated into the full Optimizely solution.
4. Best practices for add-on management
- Minimize customizations: Encapsulate changes or use extension points rather than altering third-party code directly.
- Regular updates: Keep add-ons updated to the latest compatible versions to benefit from fixes and improvements.
- Dependency management: Use automated tools like Dependabot or Renovate to track NuGet package updates.
- Documentation: Maintain clear records of installed add-ons, versions, configurations, and any modifications made.
Conclusion
Managing add-ons in CMS 12 and Commerce 14 requires a clear understanding of ASP.NET Core compatibility and updated installation and upgrade procedures. Third-party add-ons may be relatively straightforward to update, but custom solutions often need significant refactoring. Following best practices ensures add-ons remain maintainable, functional, and beneficial within Optimizely DXP solutions.
