Project system displays the C# warning levels mechanism for F# project
This issue has been moved from a ticket on Developer Community.
[severity:It bothers me. A fix would be nice] I have an project for fsharp, it is Microsoft.NET.Sdk with targetframework net6.0-windows. When I right click the project in the solution explorer, and click properties, I can scroll down to the "Errors and warnings". The Warning level is default set to 3. From the dropdown menu, it gives the option to set it to "7 - Warnings from C# 11". When I select this option, and build the project, it wails with an error: Severity Code Description Project File Line Suppression State Error FS1050 Invalid warning level '7' ProjectName C:\Users\username\foldername\Documents\foldername\Products\projectname\src\solutionname\projectnamei\FSC 1 Active
Original Comments
Feedback Bot on 6/10/2022, 10:26 AM:
(private comment, text removed)
Original Solutions
(no solutions)
@vzarytovskii The project system displays the C# warning levels mechanism for F# project, we should look at this.

I originally reported this bug because we noticed that the builderver using Build tools MSBuild reported more warnings then visual studio on the local machine. When I stated investigating this issue, I noticed that the C# warning level is being used for f# projects and I was hoping that this could be cause solution of my problem.
Is there any known workaround or fix available to see all the warnings for my f# solution in visual studio?
@vzarytovskii I'd love to tackle this. Do you happen to know off-hand where this is located? Otherwise, I'll search around a bit.
@vzarytovskii I'd love to tackle this. Do you happen to know off-hand where this is located? Otherwise, I'll search around a bit.
I don't think it's part of this repository. Probably it's in dotnet/proj-info
Found it, and reported: https://github.com/dotnet/project-system/issues/9469.
This changed was introduced in 2022 without any mention of F# in https://github.com/dotnet/project-system/pull/7982 and https://github.com/dotnet/project-system/pull/8004.
Is there any known workaround or fix available to see all the warnings for my f# solution in visual studio?
Yes @MatthijsPrent. Set the warning level to 5 (you can ignore the description of that level).
A fix is in PR here: https://github.com/dotnet/project-system/pull/9511
@vzarytovskii @abelbraaksma @KevinRansom are there other properties in the VS Project Properties UI that don't work, or are missing? It's very easy to adjust these properties now, so let me know if changes are needed. At least, keep it in mind for future.
@vzarytovskii @abelbraaksma @KevinRansom are there other properties in the VS Project Properties UI that don't work, or are missing? It's very easy to adjust these properties now, so let me know if changes are needed.
Not from the top of my head now. We will probably update them later to support nullable references. Thanks for fixing it!