I have a Windows Service and a UI application which are developed on .NET (C#). When I start windows service, windows service will start UI application corresponding with logon user => Successfully
In my application, I have a button to open a log file by default editor by coding like that:
// filePath is path to text file
// Example: C:\UserData\logs\abc.log
System.Diagnostics.Process.Start(filePath);
If I set default editor of log file is notepad or wordpad, it work ok.
But if I set default editor is Notepad++, It will show messagebox:
- Load langs.xml failed!
- Load stylers.xml failed!
Another, If I open this text file by Notepad++ by double-click, it work ok. These errors only show when I open file by C# code.
Enviroment:
- .NET framework 4.7.1
- Windows 10 32-bit
- Notepad++ 7.6.4 (32-bit)
- Application is started by Windows Service as same as Logon Session of active user.
How can I solve this issue?