.NET Based OPC UA Client/Server SDK
3.3.0.530
|
Create a new C#
project of typ Console App(lication)
with the target framework .NET Framework 4.5
.
To setup the OPC UA .Net SDK Nuget Package Repository
D:\UnifiedAutomation\UaSdkNetBundleBinary\NuGetPackages
by default.To install Nuget packages in your project
Don't forgett to add the using for UaBase
at the end of the using-block in Program.cs.
At first add a new folder in your solution named License
.
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.
To finish the task you have to set the BuildAction of the license file to Embedded Resource
.
To use the license, you must add it to the LicenseManager. Therefore, add the following code in main()
in Program.cs
.
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.