c# - System.IO.FileNotFoundException occurs after call to DirectoryEntry() -
i debugging small c# app wrote. app seems run fine on development box throws following errors when run on other machines (all machines windows 7 pro x64 w/ .net 4 installed):
application: wolapp.exe framework version: v4.0.30319 description: process terminated due unhandled exception. exception info: system.io.filenotfoundexception stack: @ wolapp.powermodel..ctor() @ wolapp.powercontroller..ctor() @ wolapp.program.main()
a second error succeeds 1 kernelbase.dll, but, 1 thing @ time....
from stack trace seems unhandled exception being throwin inside of powermodel constructor, consists of this:
public powermodel() { entry = new directoryentry(); }
where entry field of powermodel class. have since added following try catch block
public powermodel() { try { entry = new directoryentry(); } catch (system.io.filenotfoundexception e) { string ssource; string slog; string sevent; ssource = "wolapp"; slog = "application"; sevent = e.message; eventlog.createeventsource(ssource,slog); eventlog.writeentry(ssource, sevent); } }
yet same exception still thrown (and on external machines)?
also, additional message appears in log windows error reporting, follows:
1745074215 5 clr20r3 not available 0 wolapp.exe 1.0.0.0 4d657be0 wolapp 1.0.0.0 4d657be0 3 26 system.io.filenotfoundexception c:\users\username\appdata\local\temp\werc3ef.tmp.werinternalmetadata.xml c:\users\username\appdata\local\microsoft\windows\wer\reportarchive\appcrash_wolapp.exe_62bdee217c82fa90fcdaeb137c1659c897785b85_20036868 0 ce7dc05c-3f93-11e0-8907-0024e82e58f8 0
directoryentry
class system.directoryservices
namespace , deals entries in active directory.
it has nothing whatsoever entry in directory on disk ... surprised filenotfoundexeption
this...
(not applicable) or if it's not system.directoryservices.directoryentry
you're talking about, it's extremely bad choice of class name class!
Comments
Post a Comment