ApplicationInstance in UaBase.Windows for loading XML

Questions regarding the use of the .NET SDK 2.0 for Server or Client development or integration into customer products ...

Moderator: uasdknet

Post Reply
ctgarvey
Sr. Member
Sr. Member
Posts: 14
Joined: 17 Mar 2013, 13:27

ApplicationInstance in UaBase.Windows for loading XML

Post by ctgarvey »

The manual says:
Options for Loading Configuration Settings
The configuration settings are managed by the class ApplicationInstanceBase. The settings have to be set in code. The derived class ApplicationInstance in UaBase.Windows provides options to load the settings from XML in addition.
I want applicationinstance to load the endpoint settings from the app.config file, but i cannot get this to work .Compilation keeps failing with 'server configuration error no endpoints defined' I am targeting .NET 4.7.2. The code is based on the lesson1 server code. (excerpt from program.cs below)

// Start the server.
Console.WriteLine("Starting Server.");
GettingStartedServerManager server = new GettingStartedServerManager();

ApplicationInstanceBase application;

application = ApplicationInstance.Default;

application.AutoCreateCertificate = true;

application.UntrustedCertificate += Application_UntrustedCertificate;

//i dont know how to load in the app.config settings
//application.LoadConfiguration(silent,server);

application.Start(server, null, server);

// Print endpoints for information.
PrintEndpoints(server);

// Block until the server exits.
Console.WriteLine("Press <enter> to exit the program.");
Console.ReadLine();

What do i have to do, using the SDK V3.02 and targetting .NET 4.7.2, to load in endpoint settings from the app.config file? I dont want to load them from code with ConfigureOpcUaApplicationFromCode();

Thanks in advance folks.

Post Reply