Documentation Center

Creating a connector using the template for .NET

Use the Tridion Connector Template for .NET to quickly build a new .NET connector.

Before you begin

This task requires that you have installed on your machine version 3.1 of the .NET Core SDK. Download the .NET Core SDK for either Windows or Linux from the following location: https://dotnet.microsoft.com/download/dotnet-core/3.1

Procedure

  1. Open a command line and run the following command to install the template:
    dotnet new --install Tridion.Connector.Template
    The command installs the template to your .NET Core environment. You can verify that it's properly installed by running only the dotnet new command.
  2. Create a folder where you want to generate a new connector project.
  3. From a command line, go to the folder you created in the previous step and run the following command:
    dotnet new tridionconnector --name PROJECT_NAME

    Where PROJECT_NAME is the name you want to use for the new project. As a best practice, we suggest you use the same name as the folder containing the project.

    The command builds the connector project with everything you need to build your custom connector. The project includes the following resources and samples:

    • Entity types
    • Capability implementations
    • Test data
    • Icons
    • Add-on manifest
    • Connector configuration
  4. Edit the manifest.json file, as needed.
  5. From the command line, run the following command to generate the Add-ons package:
    dotnet build
  6. Upload the package (as a ZIP file) to the Add-ons feature.
  7. Open the PROJECT_NAME.json configuration file that is created from the template, and edit the configuration, as needed.

    In general, evaluate the available properties described in a separate topic and configure as needed for your scenario.

  8. Upload the custom configuration file to the connector's details view in the Add-ons feature.
  9. If the connector's integration uses Public Content API, then restart the Content Service.
  10. If the connector's integration uses ECL, then refresh the Content Manager Explorer (such as using F5).

Results

The connector is ready for use in your Tridion Sites implementation.

The following example illustrates the full output from generating a connector project:

> dotnet new tridionconnector --name Example
The template "Tridion Connector Template" was created successfully.

Processing post-creation actions...
Running 'dotnet restore' on /Users/user1/Code/Example/Example.csproj...
Restore completed in 465.21 ms for /Users/user1/Code/Example/Example.csproj.X`X`

Restore succeeded.