I am testing a Windows service. The service code fails when it tries to delete a read only file I created in %windir%\SysWOW64
, but the exception that is logged is:
Access to the path 'C:\Windows\system32\CanvasImages\62230.jpg' is denied.
I know 64 bit Windows has a whole lot of tricks up its sleeve concerning these two folders, and understand a little of it, but some accurate exception info would be nice.
%windir%\SysWOW64
" - why? Why are you writing in%windir%
? Why are you writing inSysWOW64
? What code exactly throws that exception? What other exception would you like to see? See MSDN: File System Redirector for more info on what is happening. – BremerAccess to the path 'C:\Windows\SysWOW64\CanvasImages\62230.jpg' is denied.
I have since added code to set the service's current directory to its codebase directory, i.e. where the service exe that I compile resides. – CabbagewormSysWOW64
, but by default it has its current directory set to that folder. The service executable is sitting right where I want it now, in the project's output folder, i.e.bin\Debug
. – Cabbageworm