.net - UnauthorizedAccessException when writing text file to C:\ on Windows 7 -


i have moved windows 7. .net application fails writing log file c:\

my tracelistener throwing exception.

a first chance exception of type 'system.unauthorizedaccessexception' occurred in mscorlib.dll 

what do? running application studio , think must inherit rights , admin on pc.

if have uac enabled won't able write files c:\, if you're admin, unless start program in elevated mode activate admin privileges.

files shouldn't placed in root of c:, best create subdirectory , give access rights (to account, not administrators group). if want have file on c:\ , not run elevated, can use windows explorer grant (your account, not administrators group) write access c:\.


Comments

Popular posts from this blog

c# - SharpSVN - How to get the previous revision? -

c++ - Is it possible to compile a VST on linux? -

url - Querystring manipulation of email Address in PHP -