Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Interesting NullReferenceException Error VB.NET - Windows Service

Posted on 2004-10-05
2
Medium Priority
?
279 Views
Last Modified: 2008-02-01
Hello,

I'm wiritng a service, and when attempting to start the service (after installing using installutil) I receive this is the Application Log:

Service cannot be started. System.NullReferenceException: Object reference not set to an instance of an object.
   at PxpParser.PxpParser.StartWatch() in C:\Visual Studio Projects\PxpParser\PxpParser.vb:line 135
   at PxpParser.PxpParser.OnStart(String[] args) in C:\Visual Studio Projects\PxpParser\PxpParser.vb:line 363
   at System.ServiceProcess.ServiceBase.ServiceQueuedMainCallback(Object state)



Funny thing is my Line 135 reads like this:
watcher.Path = dump

AND dump is defined earlier (outside of the funciton that line 135 is in) on line 29 as:
 Public dump As String = "c:\cytodata\dump"


AND My line 363 is just the StartWatch() in:
 Protected Overrides Sub OnStart(ByVal args() As String)
              StartWatch()
    End Sub


So What the HECK is going on! I don't get it...This service should be starting up and I am pulling my hair out. I need some direction please. Thanks in advance!!

-- croag


0
Comment
Question by:croag
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 4

Accepted Solution

by:
VIkasumit earned 375 total points
ID: 12234314
Hi..

Check the Defination of watcher

If it not intialize with new keyword it is not going to accept the value.

And give a little bit more code around if that doesn't solve your problem

VIkasumit
http://www.sumitgupta.5gigs.com
0
 
LVL 1

Author Comment

by:croag
ID: 12240591
i see what you mean. I actually need to have this project done soon. I have posted it on rentacoder.com for a couple of $$. Check it out if you would like to.  

http://www.rentacoder.com/RentACoder/misc/BidRequests/ShowBidRequest.asp?lngBidRequestId=197044

Thanks,

Croag
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Article by: jpaulino
XML Literals are a great way to handle XML files and the community doesn’t use it as much as it should.  An XML Literal is like a String (http://msdn.microsoft.com/en-us/library/system.string.aspx) Literal, only instead of starting and ending with w…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…

688 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question