Situation
You want to use the ‘dynamic’ type in your unit-test.
Problem
An InvalidOperationException that says ‘Dynamic operations can only be performed in homogenous AppDomain.’ is thrown.
Solution
Changed the attribute ‘enabled’ of the node ‘legacyCasPolicy’ to ‘false’ in the following configuration file:
C:Program Files (x86)Microsoft Visual Studio 10.0Common7IDEPrivateAssembliesMicrosoft.Moles.VsHost.x86.exe.config
Sources
- http://weblogs.asp.net/mjarguello/archive/2011/04/26/using-moles-with-dlr.aspx
- http://www.cameronfletcher.com/post/InvalidOperationException-Dynamic-operations-can-only-be-performed-in-homogenous-AppDomain.aspx
- http://social.msdn.microsoft.com/Forums/en/pex/thread/0a931fc1-9049-482a-bf2d-5499ccf65b82
- http://stackoverflow.com/questions/4230909/odd-exception-in-mvc-3-project
Leave a Reply