This is due to the fact that when you start the application as a console, you log on to the computer as you, the user, and therefore can access your "My Documents". When the Windows service is running (by default), it will work as a local system that does not have a My Documents folder. This is because Windows services start when the computer starts and do not require user login.
The question is, what are you trying to do with the My Documents folder, and your Windows service probably wants to access a location that is independent of the user?
Finally, to make it clear, imagine if you had 10 users on your computer. Which My Documents user will use the Windows service if no one has signed up yet?
source share