Quantcast
Viewing latest article 8
Browse Latest Browse All 10

Installing and Debugging a windows Service

Here is some useful information that I always seem to forget when developing windows services.

  • To install/uninstall manually, which i find helpful to do from the bin folder of your project use the following commands:
    • INSTALL: %windir%\Microsoft.NET\Framework\v2.0.50727\InstallUtil.exe [the name of the executable]
    • UNINSTALL: %windir%\Microsoft.NET\Framework\v2.0.50727\InstallUtil.exe -u [the name of the executable]
  • To Debug a windows service add the following code to your Main method

    static void Main(string[] args)
    {
    #if DEBUG
    System.Diagnostics.Debugger.Break();
    #endif

    ServiceBase.Run(new Service());

    }

  • To create an installation package for a service: ....I will come back to that - no time to put it together today Image may be NSFW.
    Clik here to view.
    :)

Technorati Tags: , , ,


Viewing latest article 8
Browse Latest Browse All 10

Trending Articles