The shutdown method of the NodeManager doesn't work in Windo

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

Moderator: uasdknet

Post Reply
ggokka
Sr. Member
Sr. Member
Posts: 17
Joined: 03 Jul 2015, 02:34

The shutdown method of the NodeManager doesn't work in Windo

Post by ggokka »

The shutdown method of the NodeManager doesn't work in Windows Service Enviornment.
Below code works only in the console application mode.

Why?

Code: Select all

public override void Shutdown()
{
    //cleanup code
}

User avatar
Support Team
Hero Member
Hero Member
Posts: 3073
Joined: 18 Mar 2011, 15:09

Re: The shutdown method of the NodeManager doesn't work in W

Post by Support Team »

Hello,

If you install the server as a service using commandline argument "/install" and InstallationSettings:InstallAsService = 'true', the Shutdown method of the NodeManager is called. We verified this by adding a trace command to the Shutdown method.

Please describe the steps to reproduce.
Best regards
Unified Automation Support Team

ggokka
Sr. Member
Sr. Member
Posts: 17
Joined: 03 Jul 2015, 02:34

Re: The shutdown method of the NodeManager doesn't work in W

Post by ggokka »

Do you have any sample project of 'InstallAsService'

User avatar
Support Team
Hero Member
Hero Member
Posts: 3073
Joined: 18 Mar 2011, 15:09

Re: The shutdown method of the NodeManager doesn't work in W

Post by Support Team »

Hello,

You can use the DemoServer application.
Please add the following lines to the InstallationSettings section of app.config:

Code: Select all

            <InstallAsService>true</InstallAsService>
            <ServiceName>OpcUaServer</ServiceName>
Then start the application with commandline argument '/install'. You will need administrator rights for this step.
Now you can start and stop the service with the services app of Microsoft.
Best regards
Unified Automation Support Team

Post Reply