There is at least one compilation error.
Payment_NZ_BNZ.cs(894,35): error CS0234: The type or namespace name ‘ManagementObjectCollection’ does not exist in the namespace ‘System.Management’ (are you missing an assembly reference?)
I do not know why it is complaining given that System.Management is referenced. I even tried to upgrade NuGet Package and changing versions for System.Management. It seems that Epicor do not allow using WMI with System.Management.
If you didn’t add it to usings, you would need to call it out by fully qualified name:
System.Management.ManagementObjectCollection collection;
vs.
ManagementObjectCollection collection;
If that doesn’t help (which it might not since it seems that it is already looking for it in the correct namespace) - maybe your assembly was referenced but didn’t load for some reason?