Using Declarations and Assembly Attributes
You must ensure a MoledType assembly attribute is present, for the type specified by the exception. For example:
Refer to the How Do I Make My Test Use Moles post, for more details.
Mode of Execution
If you are certain you have included all of the required using declarations and assembly attributes, examine your method of execution. Pex and Moles tests require special instructions to be sent to the compiler, to properly route calls through the Moles assembly. Third party test execution utilities, such as CodeRush, do not provide this supplemental information. A missing instrumentation exception will be thrown, when Pex and Moles tests are executed by CodeRush.
Unsupported Test Framework
Pex and Moles support both the Visual Studio and NUnit Test Frameworks. Other frameworks are not supported.