The .NET SDK comes with many templates and also allows the creation of custom templates. We’ve now made our own repository of DataMiner-related templates that you can install as a NuGet package or customize even further.
By default, when you install .NET SDK, this includes many templates that you can, among others, use via the dotnet new
command. For example, to create a new console application via the command line or a terminal in Visual Studio Code, you can use the following command:
dotnet new console -n ExampleConsoleApp
It is also possible to create custom templates, and that’s exactly what we did! We now have a public GitHub repository that contains DataMiner-related templates. Currently, the repository contains solution templates for connectors and Automaton scripts, and more will be added soon.
To make it easy for you to use the templates, we have published them as a NuGet package: Skyline.DataMiner.VisualStudioTemplates.
If you use Visual Studio 2022, the new templates will also be available for you in Visual Studio when you create a new project. Select File > New > Project, and you’ll see them in the Create a new project window.
The latest version of DIS (v2.42) supports these new templates. It automatically installs the templates package when you open Visual Studio. As soon as more recent versions become available, they will also automatically get installed.
Don’t have the latest version of DIS installed yet?
You can also make your own customized templates based on the templates we’ve introduced. Just fork our GitHub repository, and you can customize the template exactly the way you want it (e.g. add your own copyright, add default values such as the provider in the connector template, etc.). Then create a NuGet package for your customized templates and install that NuGet package instead of the one we provide.
In DIS, you can then also make sure your own customized templates are used by specifying the NuGet package ID in the settings window.
You can also use the dotnet CLI to manage the templates. To install the templates, use the dotnet new install command:
dotnet new install Skyline.DataMiner.VisualStudioTemplates
This will install the NuGet package. When that’s done, you can create a connector or Automation script solution via the dotnet CLI. For example, to create a new Automation script solution, you can use the following command:
dotnet new dataminer-automation-solution -name "ExampleScript" -auth "Joe"
To see all the available options for a template, use the command dotnet new <template-name> --help
. For example:
dotnet new dataminer-connector-solution --help
New to DIS?
If you haven’t used DIS before and want to find out all about this extension for Microsoft Visual Studio, visit our DIS expert hub for detailed information, downloads, and more.