Integrating a project
The content of a framework project can be referenced in an HMI project in the same Visual Studio solution or exported as a NuGet package. As a package it can be imported several times into different projects and thus reused.
Integration via reference
For integration via a reference select "Add Reference...". This opens a dialog in which all framework projects within the same solution are listed:
If the project was selected with the checkbox, it is shown under References in the HMI project:
When the framework project is built, the HMI project recognizes this and updates the controls and other files from the referenced project.
Integration via NuGet package
Before the current content can be integrated, it must be created as a NuGet package. This can easily be done via the menu item "Create NuGet Package ...":
The package is created in the directory C:\TwinCAT\Functions\TE2000-HMI-Engineering\References
. In Visual Studio this directory is known as "TwinCAT HMI Customer“. The file name is generated from the package name and its version number. Both can be set in the nuspec file.
To integrate the created file into an HMI project, select "Manage NuGet Packages ...":
Here, "TwinCAT HMI Customer" is selected on the right-hand side of the NuGet Package Manager, and the new package can be seen in the "Browse" tab.
If the package was selected with "Install", it is shown under References in the HMI project:
Passing on NuGet packages
Since the package forms a closed unit, it can also be passed on as a file. Different options are available.
- Direct file transfer: To this end the file must be copied to the directory
C:\TwinCAT\Functions\TE2000-HMI-Engineering\References
on the target computer. It is then available for selection in the NuGet Package Manager. - A shared directory: In applications where packages are exchanged on a regular basis, additional directories can be defined as package sources. The setting for this can be found in the Visual Studio options under NuGet Package Manager/Package Sources:
- Furthermore it is possible to make the packages available in the public NuGet gallery at nuget.org.