vb.net - ManagementException: Not found -


i have program runs on wearable terminals in our warehouse. these terminals connect via remote desktop our server hosts , runs program.

this program takes scan of product, launches program (if isn't running current user) handles processing, additional processing once finished. 1 issue i'm running checking if second program running. i've tried lot of different code settled on seemed work fine.

private function checkprintlabelrunning() boolean     dim selectquery string = "select * win32_process name = 'vbprintlabel.exe'"     dim searcher new system.management.managementobjectsearcher(selectquery)     dim processlist system.management.managementobjectcollection = searcher.[get]()      each obj system.management.managementobject in processlist         dim arglist string() = new string() {string.empty, string.empty}         dim returnval integer = convert.toint32(obj.invokemethod("getowner", arglist))         if returnval = 0             if arglist(0).tostring.toupper = environment.username.toupper                 return true             end if         end if     next      return false end function 

on thursday, while users using application on terminals, following error message popped in error logs. application has seemingly been closing down, hitting main form's formclosing event (indicating isn't full crash, handled inappropriately or environment crash perhaps?). here exception:

system.management.managementexception: not found     @ system.management.managementexception.throwwithextendedinfo(managementstatus errorcode)    @ system.management.managementobject.invokemethod(string methodname, managementbaseobject inparameters, invokemethodoptions options)    @ system.management.managementobject.invokemethod(string methodname, object[] args)    @ vbfullcasepicking.frmfullcasepicking.checkprintlabelrunning()    @ vbfullcasepicking.frmfullcasepicking.startprintlabellistener()    @ vbfullcasepicking.frmfullcasepicking.printlabel(boolean blnsmplabels, string strcartonid) 

i point out in particular issue, application did not close down, still curious error it's first i've seen of months has been in use.

edit: more info...the server application runs on windows server 2003. issue has not generated event log entries of kind far can see.

edit 2: forgot this, i have previous question regarding issue. querying processes seemed cause errors when multiple users try query @ same time. same issue, then, smaller window. input appreciated.


Comments

Popular posts from this blog

javascript - Using jquery append to add option values into a select element not working -

Android soft keyboard reverts to default keyboard on orientation change -

jquery - javascript onscroll fade same class but with different div -