Does the ";;" imply that you tried this in the F# interactive? Did you try from a .fs file in the sol'n?

By on 9/5/2009 2:41 PM ()

Thanks for the hint, I tried different things. Actually running the example in fsi works, but there seems to be a problem with F# build configurattions in VS2010 Beta1.

Lars

By on 9/5/2009 10:54 PM ()

There is a known issue with the VS2010 Beta release which affects any solutions which have an F# project referencing a C# or VB project. The VS2010 Beta1 release notes contain the following. The root issue is that C# and VB projects now target x86 by default, instead of AnyCPU, and the F# project system has a bug that prevents compiling a solution containing projects targeting x86.

2.4.3.3 An F# project that has a project reference to a Visual C# project or a Visual Basic project causes the Visual C# or Visual Basic project build to fail

Visual C# and Visual Basic projects default to target platform "x86" in Visual Studio 2010, but F# projects target "AnyCPU". An issue in the F# project system prevents solutions from containing projects that target different platforms.

<i>To resolve this issue:<i> Workaround 1 - Use assembly references instead of project references. i. For any Visual C#/Visual Basic projects that are referenced by an F# project, remove the project reference from the F# project. ii. Add to the F# project assembly references to the output of the Visual C#/Visual Basic projects. Workaround 2 - Use the Configuration Manager to set the Visual C#/Visual Basic projects to target AnyCPU. i. Open Configuration Manager ii. For any Visual C#/Visual Basic projects that are referenced by an F# project, on the "Platform" drop-down list, select "<New>". iii. In the New Project Platform dialog box, accept the default "Any CPU" for the New Platform, but clear "Create new solution platform". iv. Click OK, and then Close. v. Build should now successfully build AnyCPU binaries. Workaround 3 - Manually modify the Visual C# or Visual Basic project file to target AnyCPU. i. For any Visual C#/Visual Basic project that is referenced by an F# project, unload the project and then edit its project file (.csproj or .vbproj). ii. Replace all occurrences of "x86" by using "AnyCPU". iii. Reload the project. iv. Build now successfully builds AnyCPU binaries.

By on 9/6/2009 2:30 AM ()

Okay, this confirms my assumption. I messed around with build configurations but didn't get it to work.

Thanks for posting the workarounds here.

Lars

By on 9/6/2009 4:58 AM ()
IntelliFactory Offices Copyright (c) 2011-2012 IntelliFactory. All rights reserved.
Home | Products | Consulting | Trainings | Blogs | Jobs | Contact Us | Terms of Use | Privacy Policy | Cookie Policy
Built with WebSharper