Access to the path [C:\blah blah blah.txt] is denied
I have an C# app that simply reads an data from the server and translates them into a txt file. The codes were originally from VB 2005 or VB 2008 (inherited from my previous colleague who resigned) Thus, i imported all the codes into vb 2010. When i debug, the codes run perfectly fine. Whenever i publish as a exe file or a standalone, I encountered “Access to the path [C:\blah blah blah.txt] is denied". Nothing else is changed, I tried to change folder permissions and set it to owner and maximum rights to the user.

My server is Windows Server 2008 R2
EDIT: im not using IIS as it is not a web server, its just a normal server holding my database.
Access to the path [C:\blah blah blah.txt] is denied
===

I have an C# app that simply reads an data from the server and translates them into a txt file. The codes were originally from VB 2005 or VB 2008 (inherited from my previous colleague who resigned) Thus, i imported all the codes into vb 2010. When i debug, the codes run perfectly fine. Whenever i publish as a exe file or a standalone, I encountered “Access to the path [C:\blah blah blah.txt] is denied". Nothing else is changed, I tried to change folder permissions and set it to owner and maximum rights to the user.

My server is Windows Server 2008 R2
EDIT: im not using IIS as it is not a web server, its just a normal server holding my database.