.NET Based OPC UA Client/Server SDK  3.3.3.537
Setup a new Server Project

New Visual Studio Project

Create a new C# project of typ Console App(lication) with the target framework .NET Framework 4.5.

NewServerProject_VisualStudio.png
Create a new Console project

Setup NuGet Packages

To setup the OPC UA .Net SDK Nuget Package Repository

  1. Go to menu Tools > NuGet Package Manager > Package Manager Settings
  2. In the left tree select Package Sources (0)
  3. Add a new package source with pressing the green cross button (1)
  4. Add the Source path to the NuGet packages (2).
    The packages are located in D:\UnifiedAutomation\UaSdkNetBundleBinary\NuGetPackages by default.
  5. Choose a name of your choice. (3)
  6. Finish and update the package source. (4)
NewProject_SetupNugetPackages_CratePackageSource.png
Create NuGet package source

Install Nuget Packages

To install Nuget packages in your project

  1. Go to menu Tools > NuGet Package Manager > Manage NuGet Packages for Solution ...
  2. Select the Browse "tab" - if not already selected.
  3. Select the created package in the Package Source-Combobox in the right upper corner.
    NewProject_SetupNugetPackages_SelectDotnetSdk.png
    Select UA .Net SDK NuGet repository
  4. Install needed packages. For this server example install the packages:

Don't forgett to add the using for UaBase at the end of the using-block in Program.cs.

Add a License File

At first add a new folder in your solution named License.

NewServerProject_AddLicense_AddExistingItem.png
Add existing item

Normaly you would use your purchased license file, but for evaluation and for this example you can take the license from our code samples located by default in
D:\UnifiedAutomation\UaSdkNetBundleBinary\src\examples\UaDemoServer\License.
To see the license file set the filter to All Files (*.*), select the license file and confirm with clicking the button Add.
The license file will be copied to your project's license folder.

Note
Consider, that with the evaluation license the server will stop after one hour!
NewServerProject_AddLicense_AddFile.png
Add license file

To finish the task you have to set the BuildAction of the license file to Embedded Resource.

NewServerProject_AddLicense_SetBuildAction.png
Set BuildAction to 'Embedded Resource'

Use License in code

To use the license, you must add it to the LicenseManager. Therefore, add the following code in main() in Program.cs.

static void Main()
{
try
{
ApplicationLicenseManager.AddProcessLicenses(System.Reflection.Assembly.GetExecutingAssembly(), "License.lic");
}
catch (Exception e)
{
}
}

Configure Product

To finish this example and make your server start, you have to provide a server configuration file. Add an App.config file from an example project to your project. Same procedure as with the license file above. You can take it e.g. from D:\UnifiedAutomation\UaSdkNetBundleBinary\examples\ServerGettingStarted\Lesson01.
For more information on configuration settings, see the first lesson Options for Loading Configuration Settings and the Base Library documentation at Configuration Schema.

Finally, you must set the BuildAction of the file to None.

You are now prepared to start with Lesson 1: Setting up a Basic OPC UA Server Console Application.