I have an F# library project that depends on a C# class library project, both in the same solution. Essentially in the F# code, I do open MyLib
(where MyLib is the name of the C# project), and access some code defined in the C# project.
I compile and both projects build without errors or warnings. If I then change the target from Any CPU to x64 on both projects, the C# project still builds fine, but the F# project fails to build with error messages that tell me that it can't find the module MyLib. A rebuild of the solution doesn't help. Removing all bin og obj folders also doesn't help. If I change the platform target back to Any CPU or to x86 everything compiles again.
I have reproduced this in a toy solution with two small projects containing only trivial code, so I know it's not related to my specific code.
Anyone else experienced this? Any known workarounds?
be well -h-
Update: On request, here are my exact reproduction steps.
int GetAnswer() { return 42; }
to the Class1 classAdd this code to Module1.fs, below the module Module1
line:
open MyLib
let answer = Class1.GetAnswer()
Compile. Everything should build cleanly.
UPDATE 2: Just tested it with Visual Studio 2010 Beta 1 and the behavior is the same.
OK, so I finally got some response from Microsoft.
It turns out to be a bug that's apparently been fixed in the next version of F#.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With