> i got this error during compilation:
I don't think so. I think you got it at runtime.
An unhandled exception of type 'Sytem.managment.managementException' occured
in system.management.dll
Additional information: not found
the code hangs at inParams = classObj.GetMethodParameters("CreateKey")
You need to dig into what went wrong, something like this (untested):
Try
inParams = classObj.GetMethodParameters("CreateKey")
Catch e As system.management.ManagementException
' here, examine such things as e.ErrorCode, e.Message, e.Source, etc,
' my guess is you have bumped into a security issue
End Try