Initial code for a simple Episerver Addon

PLACE FOR BLOG

Initial code for a simple Episerver Addon

Initial code for a simple Episerver Addon

marija

With this blogpost, I'll begin a series of blogposts related to packaging an Episerver Add-on.

Before building an add-on of your own, make sure to have read the official documentation.

While I was prepping the presentation for Episerver Ascend on "Building and Packaging an AddOn", I've realized there are a bit too many different approaches that all work, but this one based on Ben's Reload children was done by good practices, contained Episerver recommendations and was very easy to get started with. I grabbed that one, changed it a bit and cleared it out for someone new building an add-on an easy start.

The features for this skeleton solution are:

  • Having the proper nuget package structure
  • Zipping the content as recommended by Episerver
  • Adding the version to module.config

To begin with, I've added a GitHub project and I'll continue posting more examples, from the Ascend lab as well as the Episode with Chris Sharp.

If anyone is trying to get started with an Add-On, you can go ahead and grab the code, rename the following:

  1. Folders and solution/project references
  2. modules.config and nuspec file content
  3. Main.targets project name
  4. AssembyInfo - project name, description, owner, GUID...

There are some automatic solutions out there, but none covers everything. Make sure that when you are done, you don't get any search results on neither marija.jemuovic nor AddOn.Initial.

Next step is to add some code. This code will, by definition, depend on an Episerver package (or packages). Usually, this would be one of the .Core packages. When installing the package, use the first major version, ex. 4.0.0. After installing the Episerver add-on, add the dependency to the nuget file:

    <package>
      <metadata>
          <dependencies>
            <dependency id="EPiServer.Forms.Core" version="[4.0.0,5.0.0)" />
          </dependencies>
      </metadata>
    </package>

I am sure there are many other ways to do this, so feel free to comment and get back with feedback!

LEAVE A COMMENT