Desaware Home
Products    Purchase    Publishing    Articles   Support    Company    Contact    
Support
Product FAQ
Licensing System
CC Factory
Event Log Toolkit
Gallimaufry
IniFile Tool-5M
LineGraph-5M
NT Service Toolkit
OneTime Download
SpyWorks
StateCoder
StorageTools
VBX Legacy
VersionStamper
Downloads
Documentation
Professional Services

 

bluebar
Contact Desaware and order today

bluebar
Sign up for Desaware's Newsletter for the latest news and tech tips.

NT Service Toolkit Support

Frequently Asked Questions - .NET Specific

  1. After installing the NT Service Toolkit .NET edition, I get an error when I try to open my Control Panel.
  2. Does the .NET edition support Visual Studio 2003? I get an error when I try to run a Service compiled with VS 2003.
  3. The Service's log file displays an "Object reference not set to an instance of an object." error message when I try to start my Service.

1. After installing the NT Service Toolkit .NET edition, I get an error when I try to open my Control Panel.

The NT Service Toolkit .NET edition also allows you to create Control Panel Applets using .NET. The installation adds a couple of registry entries to include a couple of sample applets in the Control Panel. There was an error in the way these registry entries were written and that might result in an error or exception when opening the Control Panel on certain systems.

To fix the problem, you can open the registry using regedit.exe. Go to the following registry key:

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\
CurrentVersion\ControlPanel\Cpls\

Then look for either the

   dwCplNET_VB 
   dwServiceCplNET_VB    

or

   dwCplNET_C 
   dwServiceCplNET_C 
 

named values.

These named values contain the full path and file name for the sample Control Panel Applets. But the path may include one extra "\" between the name of the main NT Service Toolkit folder (defaults to "NTServiceToolkit") and the "Samples" folders which may lead to errors with the Control Panel on certain systems. Remove the extra "\" to fix this problem.


2. Does the .NET edition support Visual Studio 2003? I get an error when I try to run a Service compiled with VS 2003.

This was a problem on systems where both the VS 2002 and VS 2003 frameworks were installed. An update is available that allows you to specify the edition of Visual Studio .NET you want to compile the Service Executable with.

Run the NT Service Toolkit Files Update utility to download the latest files (please contact Desaware and include your registration information if you have a firewall or other issue that prevents the Update utility from working properly).

The new Service Configuration Wizard (NTServiceWizardNET.exe) will include an option to choose either the 1.0 or 1.1 .NET Framework - select the version that your Service Assembly DLL is compiled with.

The new Service Template File (dwsvtknt11.svt) will support the 1.1 .NET Framework, but requires that the corresponding Service Assembly DLL is compiled with .NET 1.1.

The new Service Interface file (Desaware.ServiceToolkit.Interfaces11.dll) will be used in VS .NET 1.1 projects as the reference.

The following describes how to update your Service for VS 2003.

  1. In your Service Assembly Project, remove the reference to Desaware.ServiceToolkit.Interfaces.dll and add the reference to Desaware.ServiceToolkit.Interfaces11.dll.

  2. Recompile your Service Assembly Project.

  3. Run the Service Configuration Wizard and in the Assembly Name step, select the 1.1 .NET Framework option button.

  4. After rebuilding your Service EXE, you should be able to install it and start it on a system that has the 1.1 Framework installed.

  5. You would now distribute the Desaware.ServiceToolkit.Interfaces11.dll file instead of the Desaware.ServiceToolkit.Interfaces.dll file.


3 . The Service's log file displays an "Object reference not set to an instance of an object." error message when I try to start my Service.

There are several possible causes for this.

This error message indicates an uninitialized object. If your OnStart event contains a lot of code, comment out as much code as you can from the OnStart event. You can also add a Try Catch block or use the ControlObject's Trace function to output debugging information to the trace file to figure out where the error is occurring.

If you are using the ControlObject's Trace function to output debugging information, be sure that you have specified a namespace for your Service and ServiceConfiguration classes. Otherwise, using the ControlObject will generate that error.

The namespace must match the Assembly name assigned to the Service Executable. You can specify the namespace in the project containing these classes or explicitly in code as follows:

NameSpace dwBeeper 
     
   Public Class ServiceConfiguration 
     : 
     : 
   End Class 
   
   Public Class Service 
     : 
     : 
   End Class 
   End NameSpace 
 

 


 
Products    Purchase    Articles    Support    Company    Contact
Copyright© 2012 Desaware, Inc. All Rights Reserved.    Privacy Policy