Login  
Search All Forums
Dart Home | PowerSNMP for .NET | Custom Development Reply | PowerSNMP for .NET Topics | Forums   
AuthorForum: PowerSNMP for .NET
Topic: Can not start SNMP manager in windows service
snmpuser

From: beijing
Posts: 21
Member Since: 06/11/09
posted July 30, 2009 8:24 AM

I create a SNMP manager in a class library(dll), then start it in a windows service. If I install the service on my development machine, it works fine.But if I install the service on another machine, it can not work. Could you please tell me why?

BTW, if I call the same class including SNMP manager via a windows console application, it works fine on both my development machine and any other machine.
snmpuser

From: beijing
Posts: 21
Member Since: 06/11/09
posted July 30, 2009 8:33 AM

Here is my program spinet:
--------------------------------
try
{
  snmpManager = new Manager();
  this.snmpManager.Error += new Dart.Common.ComponentErrorEventHandler(snmpManager_ErrorReceived);
  this.snmpManager.Message += new MessageEventHandler(snmpManager_Message);
  this.snmpManager.UserState += new UserStateEventHandler(snmpManager_UserState);
 
  Log.write(Initilization successed);
  }
  catch (Exception ex)
  {
   Log.WriteError(ex);
  }

K M Drake



From: Utica, NY USA
Posts: 3406
Member Since: 07/14/00
posted July 30, 2009 4:24 PM

Hi,
Please be more specific.
What happens?
Do you get an exception?
Thanks,
-ken
snmpuser

From: beijing
Posts: 21
Member Since: 06/11/09
posted July 31, 2009 12:31 AM

e.g.
(1) I create a windows service project via VS2008 (.net framework 2.0)
(2) Just add "Dart.snmp.Manager manager =new Dart.snmp.Manager()" to the start method of the service.
(3) Install the service on my development machine on which there is a development license installed, then I can start the service correctly.

(4) But if I install it on another machine with a runtime license generated by DartLicenseCompiler.exe, it can not work.
the following error is shown:
Could not start the *** service on Local Comupter.
Error 1053: The service did not respond to the start or control request in a timely fashion.

Many Thanks!
snmpuser

From: beijing
Posts: 21
Member Since: 06/11/09
posted July 31, 2009 2:53 AM

Additional,
(1) my local development machine is windows xp
(2) the target machine on which I tried to install/run the service but failed is win2003 server and the user that I used to run the service as has full Admin rights.

K M Drake



From: Utica, NY USA
Posts: 3406
Member Since: 07/14/00
posted July 31, 2009 9:22 AM

Hi,
I am unable to reproduce this - I tried deploying a service and it worked fine.

Why are you generating a different runtime license?

What happens when you use the runtime license that is created when you run the service on the development machine?

Thanks,
-ken
snmpuser

From: beijing
Posts: 21
Member Since: 06/11/09
posted August 2, 2009 10:29 PM

Here is the steps I tested:
(1) PowerSNMP for .net 4.1
(2) OS: windows xp
(3) Development Environment: vs2008, .net framework 2.0
(4) create a windows service project named WindowsServiceTest. Rename the service to SNMPManagerTestService.
(5) add EventLog to the service.designer
(6) add the following code to OnStart of the service:
  this.eventLog1.WriteEntry("starting OnStart....");
  Manager manager = new Manager();
  this.eventLog1.WriteEntry("new manager successed.");
(7) add a installer for the service. build the project.
(8) right click the solution and add a setup project named setup1. Add WindowsServiceTest to it. build setup1.
(9) install setup1.
(10) open services.msc and start the service. it works fine.
(11) open Event log. You can find three logs added with the source name:SNMPManagerTestService:
(11-1) starting OnStart....
(11-2) new manager successed.
(11-3) Service started successfully.

(continue)
snmpuser

From: beijing
Posts: 21
Member Since: 06/11/09
posted August 2, 2009 10:38 PM

Then I copy the setup1 I built to:
(1) OS: window 2003 server
(2) .net framework 2.0
(3) click setup1 to install the service on this machine.
(4) open services.msc and start the service.
(5) for a long time, a message box with the following message is shown:
Could not start the *** service on Local Comupter.
Error 1053: The service did not respond to the start or control request in a timely fashion.
(6) click OK to close the message box and you can see the service is not started and all buttons(Start, Stop, Pause, Resume) are not available.
(6) open Event Log, only the following log is added:
starting OnStart....

snmpuser

From: beijing
Posts: 21
Member Since: 06/11/09
posted August 2, 2009 11:37 PM

I use the same setup1 to test on another window xp machine different from development machine.
(1) OS: windows xp
(2) .net framework 2.0
(3) click setup1 to install the service on this machine.
(4) open services.msc and start the service.
(5) a message box with 7-Day Trial license information is shown.
(6) the service started successfully.
(7) open Event log. You can find three logs added with the source name:SNMPManagerTestService:
(7-1) starting OnStart....
(7-2) new manager successed.
(7-3) Service started successfully.

Please tell me
(1) why the service can not be started on Windows server 2003
(2) How to generate a runtime license without a 7-Day trial inforamtion on an un-development machine.

Thanks!
K M Drake



From: Utica, NY USA
Posts: 3406
Member Since: 07/14/00
posted August 3, 2009 8:52 AM

Hi,
You should not generate a runtime license on the target machine; you must generate it on the development machine and deploy it with the service.
The runtime license is generated the first time the service is run on the licensed development machine.

If you still have problems after doing this, please send a simple demo to support@dart.com.
The installation itself would be super - just make sure the runtime license is part of it.

Thanks,
-ken
Reply | PowerSNMP for .NET Topics | Forums   
This site is powered by PowerTCP WebServer Tool PowerTCP WebServer for ActiveX