As several people have found, Moles does not work well with DLR. Check Cameron’s post for this issue.
In order to make it work do the following:
- Go to folder C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\PrivateAssemblies\
- Backup files Microsoft.Moles.VsHost.exe.Config / Microsoft.Moles.VsHost.x86.exe.Config (depending on your application’s platform)
- Modify the starup element and set the useLegacyV2RuntimeActivationPolicy to false in the .config file.
- Modify the legacyCasPolicy element and set the enabled to false the .config file.
I haven’t done further testing on changing the use of legacy CAS Policy when using Moles & VS Test Framework.
Let me know how it works for you.