Using the bcpToolkit .NET library

Follow these steps to use the bcpDevKit library in your C# project

To use the .NET library you first need to install the bcpToolkit on your development machine.
The library contains the API's to to create your own BCP-package.

It requires your project targeting at least .NET framework 4.5 !

1. Reference the bcpDevKit assembly

In Visual Studio right-click on References and click “Add References”.
Search for the assembly “bcpDevKit ” in Assemblies-tab and add it to your project.

The assembly will be referenced from the GAC, therefore set “Copy Local” to “false” (when using Visual Studio 2012 this should be done automatically).

2. Create the BcpServiceBuilder and set the PackageLocation

In order to gain access to the bcpDevKit API's, following namespaces should be imported:

using bcpDevKit;
using bcpDevKit.Entities;
Root entry point is the class BcpServiceBuilder:
var bcpSvcBuilder = new BcpServiceBuilder();
First we set the target BCP Version for which the package should be created:
bcpSvcBuilder.Version = BcpVersion._2019;
Then we set the PackageLocation, where the Package should be exported to:
bcpSvcBuilder.SetPackageLocation("C:\\Temp\\HelloWorldPackage");

3. Build the BcpService and start working

After preparing the BcpServiceBuilder with the desired settings we can now build the BcpService:

var bcpService = bcpServiceBuilder.Build();
The BcpService gives us access to all the functionality for creating a importable BCP package.
We can start to add Files and Items to our package:
var file = bcpService.FileService.AddFile("$/HelloWorldFiles/Hello.iam", @"C:\HelloWorldFiles\Hello.iam");
var item = bcpService.ItemService.AddItem("999", "World", "Title 999", "Desc 999");

4. Create the BCP package

Finally we can create and export our BCP package to our package location by calling Flush on the BcpService:

bcpService.Flush();
After calling the function you can find the created package in your packageDirectory:

The package can now be used to import the data into Vault.

Install bcpToolkit on customer machine

When shipping your projects binaries to your customer, also the customers machine requires a bcpToolkit installation.
Therefore delivering the bcpDevKit assembly within your project should be avoided, in order to not loose the benefits from bcpToolkit Update strategy.


See the complete example:

using System;
using bcpDevKit;
using bcpDevKit.Entities;

namespace HelloWorldPackage
{
    class Program
    {
        static void Main(string[] args)
        {
            var bcpSvcBuilder = new BcpServiceBuilder();
            bcpSvcBuilder.Version = BcpVersion._2019;
            bcpSvcBuilder.SetPackageLocation("C:\\Temp\\HelloWorldPackage");

            var bcpService = bcpSvcBuilder.Build();

            var file = bcpService.FileService.AddFile("$/HelloWorldFiles/Hello.iam", @"C:\HelloWorldFiles\Hello.iam");
            var item = bcpService.ItemService.AddItem("999", "World", "Title 999", "Desc 999");

            bcpService.Flush();
        }
    }
}