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

Parse XML to dynamic object in C#

C# Crop white space from around the image