The Tool itself does not have anything to do with your program, except when using an independentlygenerated class.
If you implement class generation in your program using other means it "may" cause a problem.
I did discover if you are running 32 bit windows then you need to use the 32 bit version of Mgmtclassgen.exe
or with 64 bit windows you need to use the 64 bitversion. On the output location there is a path length limit file name included.
I have not actually used one of the generated classes with a program yet, I mainly used them for information on how they are laid out and the property’s available.
All of the classed I have generated thus far have been in vb.
I have also created GUI application that builds the complete command line text for you and can list every class name whether it is dynamic or not.
If there is any interest in it I was make a download link available.