Handling App.config file in Windows Service

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • TechBabu
    New Member
    • Sep 2010
    • 2

    Handling App.config file in Windows Service

    I'm trying to read data from config file in windows service in OnStart(), but it is throwing error "Object reference not set to an instance of an object".
    Is there any seeting required to use config file in Windows Service.
    my config file name as <appName>.exe.c onfig.
    Even I placed it in the System32 folder also.
    Plz help me out how to handle config file in Windows Service.
    I'm using VS2008, C#.

    Thanks in advance.
  • Mainframe Guy
    New Member
    • Aug 2010
    • 3

    #2
    Actually , I'm getting the same error on an app that is called from a Windows service. When I run the app from a console, or even as a started task, no error; but when it is started from a service the nullexception is raised. It is inside of a try/catch block; not sure when it isn't being caught. The catch is for Exception.
    The app was developed on VS2008 using VB9.
    The problem occurs usign on Windows Server 2008; does not happen on XP.

    Comment

    Working...