--- myst: substitutions: ico_method: |- ```{image} /img/code_reference/net_library/method.ico :width: 15px ``` ico_prop: |- ```{image} /img/code_reference/net_library/prop.ico :width: 15px ``` --- # BcpServiceBuilder Class A factory that creates the [BcpService]() with the relevant settings. **Namespace:** bcpDevKit\ **Assembly:** bcpDevKit.dll ## Inheritance Hierarchy [System.Object]()\  bcpDevKit.IBcpServiceBuilder\   **bcpDevKit.BcpServiceBuilder** ## Syntax ```csharp public class BcpServiceBuilder : IBcpServiceBuilder ``` ## Properties | Type | Name | Description | |---------------------------------------------------------------------------------------------------------------------------------------------------------|------------------|------------------------------------------------------------------------------------------------------------------------| | {{ico_prop}} [BcpVersion]() | Version | Gets or sets the vault version for which you want to create a BCP package. The default version is *BcpVersion.\_2024*. | | {{ico_prop}} [DirectoryInfo] | PackageDirectory | Gets or sets the output folder where it will create the BCP package. | ## Methods | Type | Name | Description | |--------------------------------------------|--------------------------------------------|----------------------------------------------------------------------| | {{ico_method}} void | SetPackageLocation(string packageLocation) | Assigns the specified path to the PackageDirectory. | | {{ico_method}} [IBcpService] | Build() | Creates a new [IBcpService] with the relevant settings. | [IBcpService]: /code_reference/net_library/ibcpservice [BcpVersion]: /code_reference/net_library/bcpversion [DirectoryInfo]: https://docs.microsoft.com/en-us/dotnet/api/system.io.directoryinfo?redirectedfrom=MSDN&view=netframework-4.7.2 ## Remarks The *PackageDirectory* is set by default to the *TEMP* directory on your computer. More details on its determination can be found [here]().\ *SetPackageLocation* throws an exception of type *DirectoryNotFoundException* when an invalid path is passed to the function. ## Examples **Create a new BCP package and add files** ```csharp using bcpDevKit; using bcpDevKit.Entities; class Program { static void Main(string[] args) { var bcpSvcBuilder = new BcpServiceBuilder {Version = BcpVersion._2024}; bcpSvcBuilder.SetPackageLocation(@"C:\Temp\Package1"); var bcpSvc = bcpSvcBuilder.Build(); var catchAssembly = bcpSvc.FileService.AddFileWithIteration("$/Designs/Catch Assembly.iam", @"C:\Catch Assembly.iam"); bcpSvc.Flush(); } } ```