Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3962784
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T03:08:14+00:00 2026-05-20T03:08:14+00:00

I have an F# library project that depends on a C# class library project,

  • 0

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.

  1. Create a new empty solution in Visual Studio 2010
  2. Add a new C# class library project to the solution, call it MyLib
  3. Add a static method int GetAnswer() { return 42; } to the Class1 class
  4. Add a new F# library project to the solution, call it MyOtherLib
  5. Add a reference from the F# library project to the C# class library project
  6. Add this code to Module1.fs, below the module Module1 line:

    open MyLib

    let answer = Class1.GetAnswer()

  7. Compile. Everything should build cleanly.

  8. Go to the build tab in the project properties for MyLib. Change the platform target to x64.
  9. Do the same for MyOtherLib.
  10. Build again. You will now get two errors in the F# project, both complaining about namespace or modules not being defined.

UPDATE 2: Just tested it with Visual Studio 2010 Beta 1 and the behavior is the same.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-20T03:08:15+00:00Added an answer on May 20, 2026 at 3:08 am

    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#.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Suppose, I have an opensource project that depends on some library, that must be
I have a solution with an ASP.NET project and a Class library project where
I have a .Net 3.5 class library project that I've migrated to use Visual
I have a VS solution that contains 6 library projects and 1 web folder
I have a C# class library and a startup project (a console app). The
I have a Windows Service project, A, with a dependency on a class library
I have an solution in VS 2008 which contains two class library projects and
I have a library project that contains some samples in a subfolder. The library
I have several C# projects along with some internal library components that I'm trying
MSBuild 3.5 I have the following project structure: trunk/MainSolution.sln trunk/Build/MyBuild.Proj trunk/Library/... trunk/etc... So far,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.