I have run into a strange issue in my C# app. My app is using some external .dll files (MySQL for external database access and NBug for error reporting) which are stored in the same directory as the main .exe.
After installing my app, and running it from the start menu, it loads and works fine which confirms the mysql.dll is being accessed fine. However, when the app crashes (due to an unhandled exception), normally the NBug error handler will pop up, but it does not. Rather the windows style error reporter shows up.
After performing further investigations, the NBug reporter loads fine if I run the app from a location other than the Program files, like on my desktop. This lead me to believe that it might be a permissions issue. So I tried to run the app as an administrator from the Program Files, and the Nbug reporter works fine then!
Why is it behaving this way? It won't be ideal to make the user run the app as an administrator every time they launch it, nor will it be ideal to make the app request admin permissions when launching. It shouldn't need me to do this.
It also seems like it only works this way on Windows 10 as well. I have run it many times on windows 7 and XP and it does not give me this issue. Are there some kind of permission changes in Win 10? But why is the Mysql.dll working as expected, but not the NBug one?
Ok I have figured out the problem. Apparently in Windows 7/8/10 Microsoft added UAC which needs the user to give permission to the program to elevate permissions. In XP I believe this was automated without user intervention.
Now the reason why NBug needed these elevated permissions is because when called, it would write to a log file located in the same directory. So by disabling logging, NBug no longer needs elevated permissions.
This solves my issue. I'm posting as this may be helpful to others.