none
F# sample project can't build RRS feed

  • Question

  • Hi,

    I'm having a strange behaviour with all my F# files

    They're all creating C# errors

    So I've just recreated a new F# project and here's what it look like

    namespace Test
    
    module Say =
        let hello name =
            printfn "Hello %s" name

    And errors are :

    { expected
    ; expected
    A namespace cannot directly contain members such as fields or methods

    Regarding to those errors it seems that Visual is trying to build F# with C# compiler.

    But the F# tools are installed :

    F# desktop language support

    F# language support

    F# language spport for web projects


    I don't really know what's wrong, bescause I already make it work on this computer
    I also Repaired Visual

    Does anybody know what wrong ?

    Thanks for reading

    PS:
    I also reinstalled Visual but it didn't changed anything
    And the code is running on my coworkers computers
    Monday, July 15, 2019 11:59 AM

All replies

  • I'm assuming the exact same .sln/.fsproj/.fs files are working everywhere but your machine.

    In that case I'd expect something in your customization of your environment is causing the confusion.

    If they are build-time errors, then checking a detailed build log for where the wrong compiler is chosen should help find a hint.  If this is intellisense, then it may come down to comparing every setting under Tools > Options... with a colleague, and binary chopping your way through any installed extensions.

    Monday, July 15, 2019 1:08 PM