Change current directory for Windows Service to application directory

By default current directory for Windows Service is c:\windows\System32

To change it to point to your application directory execute the following in the initialization section of your windows service

Directory.SetCurrentDirectory(AppDomain.CurrentDomain.BaseDirectory);

Comments

Popular posts from this blog

Tibco Rendezvous (tibrv) C# .Net example

Parse XML to dynamic object in C#