Search Results for

    Show / Hide Table of Contents

    Create .Net Add-in Package

    In this step, we will create a new package with your .Net add-in, that is installed into the Windows client or service tier add-ins directory.

    $ErrorActionPreference = 'stop'
    
    Import-Module LsPackageTools\AddinPackageCreator
    Import-Module UpdateServiceServer
    
    $DotNetPath = 'c:\path\to\my\assemblies\*'
    
    $Arguments = @{
        Id = 'my-dotnet-server-addin'
        Name = 'My .Net Addin'
        Version = '1.0'
        InputPath = $DotNetPath
        OutputDir = 'c:\MyGoCPackages\Output'
        MinBcVersion = '8.0'
        InstallInServer = $true
        AddinDestinationDir = 'MyAppDotNetAddin'
    }
    
    # Create new addin package for server
    New-AddinPackage @Arguments -Force | Import-UssPackage
    
    $Arguments.Id = 'my-dotnet-client-addin'
    $Arguments.InstallInServer = $false 
    $Arguments.InstallInWindowsClient = $true
    
    # Create new addin package for Windows client
    New-AddinPackage @Arguments -Force | Import-UssPackage
    

    The example above will create two packages, one for the Windows client called my-dotnet-client-addin and another for the service tier called my-dotnet-server-addin.

    • InputPath: Location of your assemblies.
    • MinBcVersion: The minimum version of Business Central the assemblies are compatible with.
    • InstallInServer: If set true, the assemblies will be installed into the service tier add-ins directory and add bc-server package as a dependency.
    • InstallInWindowsClient: If set true, the assemblies will be installed into the Windows client add-ins directory and add bc-windows-client package as a dependency.
    • AddinDestinationDir: A directory name or path relative to the add-ins directory where your assemblies will be installed into. This must be a unique path for this package and non-existing. If any other files are in this directory, they will be deleted.
      • For AddinDestinationDir = 'MyDotNetAddin' the assemblies will be installed into ...\Service Tier\Add-ins\MyDotNetAddin and/or ...\RoleTailored Client\Add-ins\MyDotNetAddin.

    Next Steps

    • License Package
    • POS Bundle
    In This Article
    Back to top Generated by DocFX