Skip to content

The --langversion error text is not that useful #9019

@0x53A

Description

@0x53A

I wanted to use the new LangVersion feature and added <LangVersion>4.6</LangVersion>.

This caused an error: FSC : error FS0246: Unrecognized value '4.6' for --langversion use --langversion:? for complete list.

How is a user supposed to do that? I can't (easily) call fsc directly, it is always invoked through msbuild.


Then I thought I was smart and changed it to <LangVersion>?</LangVersion> in the project file.
On save, my VS closed. When I reopened the solution, VS also immediately closed again.
I assume there is a Process.Exit somewhere :D
(Edit: found it:

)


This is with VS 16.4.5 and .net sdk 3.1.101.

For comparison, the C# error is equally useless: error CS1617: Invalid option '12.34' for /langversion. Use '/langversion:?' to list supported values..

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions