Windows service with app.config file

Posted on 2006-03-21
Last Modified: 2012-06-27
i have a windows service with config file...
i have a path in config file which my windows service is suppose to read and do the work.

here is my config file... i dont know why it is not working.

 <!-- <add key="FilesPath" value="C:\DestinationFolder\" />
        <add key="ErrorFiles" value="C:\DestinationFolder\ErrorFiles\" />-->

        <add key="FilesPath" value="\\\c$\SourceFiles\" />
        <add key="ErrorFiles" value="\\\d$\DestinationFiles\" />

above i have given both the path's the one which uses C:\Destination works fine as it is on my computer (commented out)
but when i use the server path it doesnot work.
NOTE: I CAN ACCESS "\\\c$\SourceFiles\" THIS PATH by goin in START/RUN/and typing the path...
I am saying this is not working because when i change the path to "C:\DestinationFolder\" my windows Services works like a charm.

Please help
Question by:Junior_Developer
    1 Comment
    LVL 8

    Accepted Solution

    hmm.. try doing this.. put the code in try catch block and print the exception. you will know abt the error properly.

    all the services run under some default user account in case of windows 2003 its is NetworkService. So my probable guess is  there is permission issue to that folder. one of easy way to solve this problem will be to run service under your user account.


    Featured Post

    Live: Real-Time Solutions, Start Here

    Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

    Join & Write a Comment

    This tutorial demonstrates one way to create an application that runs without any Forms but still has a GUI presence via an Icon in the System Tray. The magic lies in Inheriting from the ApplicationContext Class and passing that to Application.Ru…
    Introduction As chip makers focus on adding processor cores over increasing clock speed, developers need to utilize the features of modern CPUs.  One of the ways we can do this is by implementing parallel algorithms in our software.   One recent…
    It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
    In this sixth video of the Xpdf series, we discuss and demonstrate the PDFtoPNG utility, which converts a multi-page PDF file to separate color, grayscale, or monochrome PNG files, creating one PNG file for each page in the PDF. It does this via a c…

    755 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

    Need Help in Real-Time?

    Connect with top rated Experts

    25 Experts available now in Live!

    Get 1:1 Help Now