Null refferance exception

Posted by Skulkarni33 under ASP.NET on 6/11/2015 | Points: 10 | Views : 267 | Status : [Member] | Replies : 1
Please help me with this..

Service cannot be started. System.NullReferenceException: Object reference not set to an instance of an object.
at ZConRepWS.DataCopy.DataCopy.Start()
at ZConRep.App.WinService.ZConRepWS.OnStart(String[] args)
at System.ServiceProcess.ServiceBase.ServiceQueuedMainCallback(Object state)

for below code am getting this error..

namespace ZConRep.App.WinService
{
public partial class ZConRepWS : ServiceBase
{
private string serviceName = "ZConRepWS";

public ZConRepWS()
{
InitializeComponent();
CanStop = true;
CanPauseAndContinue = false;
CanHandleSessionChangeEvent = true;
AutoLog = true;
}

/// <summary>
/// *** OnStart
/// </summary>
/// <param name="args"></param>
protected override void OnStart(string[] args)
{
writeLog("Service " + serviceName + " starting... ");

// Start Timer
DataCopy.Start();
}




Responses

Posted by: Jayakumars on: 6/11/2015 [Member] [MVP] Bronze | Points: 25

Up
0
Down
Hi
Check your service working or not null error means take new instance then individually check your service working or not did you seen the service request check tehm

Mark as Answer if its helpful to you

Skulkarni33, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response