So, I am just starting with F #, and I encounter a very strange problem when I get a System.MissingMethodException when using certain methods from FSharp PowerPack.
This does not happen for all methods in the same module. This also does not happen if I compile my assembly as an application and not a class library.
Playback Stages:
- Create 2 assemblies, one class library and one application.
- Add nunit.framework and the FSharp.PowerPack libraries as references to both assemblies.
Create the following test fixture in each assembly.
open NUnit.Framework [<TestFixture>] type Tests() = class [<Test>] member self.OfSeq() = // Will always succeed Matrix.Generic.ofSeq [[1]] |> ignore [<Test>] member self.OfList() = // Will fail under certain conditions with a System.MissingMethodException Matrix.Generic.ofList [[1]] |> ignore end
- Compile both assemblies.
- Open each assembly in NUnit and run all the tests.
When I do this, the application works fine (all tests pass), but the class library crashes with the following exception:
System.MissingMethodException : Method not found: 'Microsoft.FSharp.Math.Matrix`1<!!0> Generic.ofList(Microsoft.FSharp.Collections.FSharpList`1<Microsoft.FSharp.Collections.FSharpList`1<!!0>>)'. at Temp2.Tests.OfList()
What's going on here?
Another method that creates the problem is matrix.PermuteColumns.
Additional Information:
- I compile both assemblies for .NET 4.5
- I am compiling with Visual Studio 2012 RC
- I am using NUnit version 2.5.10.11092
- I am using FSharp PowerPack version 2.1.3.1 (although the properties of the DLL indicate it is 2.0.0)
Let me know if there is additional information that will be helpful.
f # missingmethodexception f # -powerpack
Lawrence johnston
source share