Yes, you missed a trick, but fortunately it is a really easy one. You just need to add a reference to the System.Management component.
You probably know how to add a reference, but just in case, here are the detailed directions for adding the reference you need from within the IDE.
1) Right click on "References" in the solution explorer.
2) Click on "Add Reference ..." on the popup menu.
3) Scroll down in the selection list until you get to the "System." section containing "System.Management".
4) Double click on "System.Management".
5) Click on "OK" at the bottom of the dialog box.
That's it. Now the IDE and compiler will recognize "System.Management", and it will add the appropriate switch to the compilation so the compiler and runtime will recognize it too.