dotnet / project-system

The .NET Project System for Visual Studio
MIT License
967 stars 386 forks source link

Illegal and C#-only warning levels shown for F# projects #9469

Closed abelbraaksma closed 2 months ago

abelbraaksma commented 4 months ago

Visual Studio Version

Visual Studio Version 17.8.6 and 17.10.0 Preview 7.0

Summary

The warning levels shown for an F# project are the ones for a C# project. Furthermore, these warning levels are invalid for F# (it uses only 1-5).

Steps to Reproduce

  1. Create or open an F# project
  2. Go to Properties page
  3. Select the dropdown box for Warning level

Expected Behavior

The F# warning levels.

Actual Behavior

The C# warning levels, some of which are invalid when selected.

1>FSC : error FS1050: Invalid warning level '7'

image

User Impact

At the least, confusion, at the worst, broken builds:

These were introduced after #7978 was implemented (through #7982 and #8004). Going over these PRs, there's nothing in these discussions (unless I missed it) that makes these options language-dependent, or, if they cannot be language-dependent, language agnostic.

I've no problem issuing a PR for this, but I'm not very familiar with this project and there doesn't seem to be a clear mechanism for these enums to be selected based on a current project language setting.

/cc @vzarytovskii