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.
EDIT 2: i can only get it to run without the error if i "Run as administrator" whereas my user has no admin rights
The reason being is probably because for one your application is a Click Once application which will require elevation as it runs under the users context, therefore if you do not have the rights to access C:\blah blah and make changes you will also be unable to use your application.
My Recommendation to you?
I personally would write the Text File into the Users Documents folder or anything associated with the Users Profile, that way your click once application should never need to be elevated as it right now runs in a managed environment with some serious restrictions.
Hope this clears things up a little bit.