I have a F # library project, which depends on the C # class library project, as in the same solution. Essentially, in 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 are built without errors or warnings. If I then changed the target from any x64 CPU to both projects, the C # project still builds fine, but the F # project cannot build error messages that tell me that it cannot find the MyLib module. Reconstruction of the solution does not help. Removing all bin og obj files also does not help. If I change the target platform to any processor or to x86, everything will compile again.
I reproduced this in a toy solution with two small projects containing only trivial code, so I know that this is not related to my specific code.
Has anyone else experienced this? Any known workarounds?
good -h -
Update: upon request, here are my exact playback steps.
- Create a new blank solution in Visual Studio 2010
- Add a new C # class library project to the solution, name it MyLib
- Add static
int GetAnswer() { return 42; } method int GetAnswer() { return 42; } int GetAnswer() { return 42; } to class Class1 - Add a new F # library project to the solution, name it MyOtherLib
- Add link from F # library project to C # class library project
Add this code to Module1.fs below the line module Module1 :
open MyLib
let answer = Class1.GetAnswer ()
Compile Everything should be built cleanly.
- Click the assembly tab in the project properties for MyLib. Change the target platform to x64.
- Do the same for MyOtherLib.
- Build again. You will now get two errors in your F # project that complain about a namespace or modules that are not defined.
UPDATE 2: Just tested it using the beta version of Visual Studio 2010 1, and everything will be different.
source share