hubFS: THE place for F#

. . . are you on The Hub?
Welcome to hubFS: THE place for F# Sign in | Join | Help
in Search

VS 2008 x 2010 F# interoperability

Last post 06-08-2009, 1:58 by markhneedham. 13 replies.
Sort Posts: Previous Next
  •  05-21-2009, 10:37 10422

    VS 2008 x 2010 F# interoperability

    Hi, I've question about VS 2008 x 2010 beta F# interoperability. Is possible to use same F# project in VS 2008 and 2010 solution? Is the F# build in VS 2010 beta same as in current VS 2008 plugin? And what about Silverlight 2, F# PowerPack and F# parser library - can we use them in both versions of VS?
    I want to upgrade to VS 2010 on my machine, but I'm also currently cooperating with my fellow schoolmates on one F#/Silverlight2 project, all of them are using VS 2008 and I can't expect, that all of them will move to VS 2010 in next day's :)
  •  05-21-2009, 10:47 10423 in reply to 10422

    Re: VS 2008 x 2010 F# interoperability

    The solution files and binaries are incompatible between VS 2008 and VS 2010. You could install VS 2010 Beta 1 in parallel, but I wouldn't yet recommend it as your primary development IDE.


  •  05-21-2009, 10:49 10424 in reply to 10422

    Re: VS 2008 x 2010 F# interoperability

    Sounds like you want to stick with VS2008 for now.

    • .fsproj files are not compatible.  This is a Visual-Studio- / MSBuild- ism.  When you open a project created with VS2008 inside VS2010, the 'upgrade wizard' will upgrade the project in place, and this will make it unusable in VS2008.
    • We have not yet posted the PowerPack binaries that are compiled for .Net 4.0, so if you need the PowerPack, VS2010 is a non-starter for the next few days until we get the PowerPack posted.
    • F# in VS2010 Beta1 targets only .Net 4.0 Beta1, whereas F# in VS2008 targets .Net 2.0/3.0/3.5.

    See also

    http://lorgonblog.spaces.live.com/blog/cns!701679AD17B6D310!1327.entry

  •  05-21-2009, 11:40 10425 in reply to 10424

    Re: VS 2008 x 2010 F# interoperability

    Regarding PowerPack - isn't it possible to take the source code from 2008 version and compile it with VS2010? I did that, and then used the produced DLL to compile FParsec successfully. Didn't check if it actually works, though, but what potential problems are there?
  •  05-21-2009, 12:18 10426 in reply to 10425

    Re: VS 2008 x 2010 F# interoperability

    FParsec doesn't need the PowerPack.

    If you comment out the (non-essential) "StructuredFormat" related code from primitives.fs and primitives.fsi, and put  "[<CompilationRepresentation(CompilationRepresentationFlags.Instance)>]" above the ToString override in error.fs and error.fsi, FParsec should compile again.

    I'm working on a major update of FParsec which I hope to be able to release on CodePlex early next week.

    - Stephan
  •  05-21-2009, 12:29 10427 in reply to 10425

    Re: VS 2008 x 2010 F# interoperability

    int19h:
    Regarding PowerPack - isn't it possible to take the source code from 2008 version and compile it with VS2010? I did that, and then used the produced DLL to compile FParsec successfully. Didn't check if it actually works, though, but what potential problems are there?

    This should probably be fine, we just assume most users don't want that hassle.  Soon when we drop the 'official' version you probably want that in case there are any differences somehow.

  •  05-21-2009, 15:19 10442 in reply to 10424

    Re: VS 2008 x 2010 F# interoperability

    brianmcn:

    • F# in VS2010 Beta1 targets only .Net 4.0 Beta1, whereas F# in VS2008 targets .Net 2.0/3.0/3.5.

    Well, that answered my question. I suppose we would just migrate to current version of F# on VS 2008 for now.
  •  05-21-2009, 15:40 10445 in reply to 10426

    Re: VS 2008 x 2010 F# interoperability

    Stephan:
    put  "[]" above the ToString override in error.fs and error.fsi


    I was actually wondering if override is needed in the .fsi at all. Since it's already defined by the base class, the fact that it's overriden there is an implementation detail, no? And I should still be able to call ToString on instances of that type even if I don't have it in the .fsi ...

  •  05-21-2009, 19:40 10454 in reply to 10427

    Re: VS 2008 x 2010 F# interoperability

    I was going to use the FSharp.PowerPack in a presentation next week. How would I go about building the PowerPack? Or should I just stick with VS2008?

    Cheers!
  •  05-22-2009, 1:16 10459 in reply to 10445

    Re: VS 2008 x 2010 F# interoperability

    int19h, you're right, the override declaration in the fsi is only for documentation purposes.
  •  05-22-2009, 7:47 10465 in reply to 10454

    Re: VS 2008 x 2010 F# interoperability

    I was able to compile my project with VS 2010 and the PowerPack from the CTP, but it would not run because of some "missing function" runtime exceptions.
  •  05-22-2009, 15:27 10477 in reply to 10465

    Re: VS 2008 x 2010 F# interoperability

    marekpetrik:
    I was able to compile my project with VS 2010 and the PowerPack from the CTP, but it would not run because of some "missing function" runtime exceptions.


    Did you just take the PowerPack assembly from the 2008 CTP as is? That won't work for sure (and the compiler will even warn you about that, saying that PowerPack is compiled against different version, and is incompatible).
  •  06-03-2009, 18:53 10767 in reply to 10477

    Re: VS 2008 x 2010 F# interoperability

    FYI, we finally have the PowerPack binaries for VS2010/.Net4.0 Beta1 online:

    http://www.microsoft.com/downloads/details.aspx?FamilyID=e475a670-9596-4958-bfa2-dc0ac29b4631&displaylang=en

    The long term plans are still to have this up on CodePlex (as mentioned a while back on Don's blog

    http://blogs.msdn.com/dsyme/archive/2008/12/10/fsharp-to-ship-as-part-of-visual-studio-2010.aspx

    ) but we wanted to go ahead and make the binaries available in the meantime, to unblock those who want to use the PowerPack on .Net 4.0 Beta1 right now.  Sorry it took so long to come online!

  •  06-08-2009, 1:58 10820 in reply to 10767

    Re: VS 2008 x 2010 F# interoperability

    Very cool.

    I originally searched for how to get the Power Pack for .NET 4.0 from Google and I ended up at this site to download it - http://www.softpedia.com/progDownload/F-Sharp-PowerPack-Download-130111.html

    The binaries there seemed to be recognised inside a script file in VS2010 but when I tried to reference the Power Pack dll from fsi 1.9.6.16 the dll wasn't loaded with this error:

    error FS0191: Error opening binary file 'C:\Program Files\Microsoft F#\FSharp-PowerPack-4.0-Beta1\FSharp.PowerPack.dll': MapViewOfFile(0x80070008)

    When I download from the Microsoft site - http://www.microsoft.com/downloads/thankyou.aspx?familyId=e475a670-9596-4958-bfa2-dc0ac29b4631&displayLang=en - it all worked fine.

    Cheers,
    Mark

    Mark Needham
    Application Developer, ThoughtWorks
    http://www.markhneedham.com/blog
View as RSS news feed in XML
Powered by Community Server, by Telligent Systems