Nuget Package Management

NuGet is a package manager designed to enable developers to share reusable code. It is a software as a service solution whose client app is free and open-source. The Outercurve Foundation initially created it under the name NuPack. Since its introduction in 2010, NuGet has evolved into a larger ecosystem of tools and services.

We shall cover the following in this tutorial.

A. How to use existing Nuget packages

 

First, we need to tell the visual studio, where is the package source, it can be the central repository, on our own hard disk (downloaded from somewhere) or it can be built by ourselves.

=>In the Visual Studio, Tools | Nuget Package Manager | Package Manager Settings | Package Source

=>Give the right name as you like and update the source URL or other folder and press  Update, the process is shown in the following image.

B. How to update my project from the repository that we have set:

Now we have set the package sources, now say we want to update a package or want to use a particular release, how should we do that?

=> In the Visual Studio Project | Manage Nuget Package

=> Now we can browse the package source, check our installed package, and update to the target version 

 

C. How to create my own Nuget package for the TwinCAT  HMI project

 Now let say, we want to create a package by ourselves and want to distribute it to the Nuget repository. We shall show it by an example that we have created in the visual studio.

=> We have an HMI project and then we have an extension project (check our extension tutorial for more), we want to make the extension project as a Nuget package and then install it to our HMI project.

=> Select the project | Create Nuget Package |

 

 If the package is already there it will show a dialog as shown in the following image.

 

Tip 01: Sometimes, we might want to use pre release version. If the package is pre release version then you need to check the include prerelease otherwise it will not be visible and  we may wonder where is my package  and so on. It is shown  in the following image.

 

Now you have reached the end of our HMI tutorial, we hope it has been useful if you have any questions you could post to our google group. If you think it can be helpful to others don’t fare to share it.

 

Ask questions related to Hemelix sample code and design at Google group https://groups.google.com/g/hemelix