chevron-thin-right chevron-thin-left brand cancel-circle search youtube-icon google-plus-icon linkedin-icon facebook-icon twitter-icon toolbox download check linkedin phone twitter-old google-plus facebook profile-male chat calendar profile-male
0 votes
I tried to use latest (6.04) version of Typemock Isolator with F#, and didn't work at all. Here are the steps:

1. Create an F# library using VS 2010.
2. Add a reference to Typemock.Isolator.ArrangeActAssert DLL
3. Build a library.
4. Try to load it in NUnit test runner or select "Run test" using Testdriven.NET.
5. The following error is displayed:

Test '' failed: Operation could destabilize the runtime.
System.Security.VerificationException: Operation could destabilize the runtime.
at Microsoft.FSharp.Core.CompilationMappingAttribute..ctor(SourceConstructFlags sourceConstructFlags)
at System.Reflection.CustomAttribute._CreateCaObject(RuntimeModule pModule, IRuntimeMethodInfo pCtor, Byte** ppBlob, Byte* pEndBlob, Int32* pcNamedArgs)
at System.Reflection.CustomAttribute.CreateCaObject(RuntimeModule module, IRuntimeMethodInfo ctor, IntPtr& blob, IntPtr blobEnd, Int32& namedArgs)
at System.Reflection.CustomAttribute.GetCustomAttributes(RuntimeModule decoratedModule, Int32 decoratedMetadataToken, Int32 pcaCount, RuntimeType attributeFilterType, Boolean mustBeInheritable, IList derivedAttributes, Boolean isDecoratedTargetSecurityTransparent)
at System.Reflection.CustomAttribute.GetCustomAttributes(RuntimeType type, RuntimeType caType, Boolean inherit)
at System.RuntimeType.GetCustomAttributes(Boolean inherit)
at NUnit.Core.Reflect.GetAttributes(ICustomAttributeProvider member, Boolean inherit)
at NUnit.Core.Reflect.HasAttribute(ICustomAttributeProvider member, String attrName, Boolean inherit)
at NUnit.Core.Builders.NUnitTestFixtureBuilder.CanBuildFrom(Type type)
at NUnit.Core.Extensibility.SuiteBuilderCollection.CanBuildFrom(Type type)
at NUnit.Core.TestFixtureBuilder.CanBuildFrom(Type type)
at NUnit.Core.Builders.TestAssemblyBuilder.GetFixtures(Assembly assembly, String ns)
at NUnit.Core.Builders.TestAssemblyBuilder.Build(String assemblyName, Boolean autoSuites)
at NUnit.Core.Builders.TestAssemblyBuilder.Build(String assemblyName, String testName, Boolean autoSuites)
at NUnit.Core.TestSuiteBuilder.BuildSingleAssembly(TestPackage package)
at NUnit.Core.TestSuiteBuilder.Build(TestPackage package)
at testListener, Assembly assembly, ITestFilter filter)
at NUnit.AddInRunner.NUnitTestRunner.AssemblyRun.Run(NUnitTestRunner testRunner, ITestListener testListener, Assembly assembly)
at testListener, Assembly assembly, IRun run)
at NUnit.AddInRunner.NUnitTestRunner.RunAssembly(ITestListener testListener, Assembly assembly)
at TestDriven.TestRunner.AdaptorTestRunner.Run(ITestListener testListener, ITraceListener traceListener, String assemblyPath, String testPath)
at TestDriven.TestRunner.ThreadTestRunner.Runner.Run()

The error is persistent and reproduceable. And apparently a serious one, since it basically makes Typemock Isolator unusable with tests written in F# - something I was trying to do.
asked by (19.4k points)

3 Answers

0 votes
BTW, I've found a similar problem: ... reporting/

The guy was using Isolator with MS Reporting Services, and just a presence of Isolator in a list of referenced assemblies caused the same error.
answered by (19.4k points)
0 votes

We're working on supporting F# code. Our next version will support executing tests which uses users F# libraries.

I'll send you a patched version that supports it.

Typemock Support
answered by (12k points)
0 votes

I can confirm that the patch works fine!

Thank you.
answered by (19.4k points)