How to globally suppress warning in visual studio

I am using visual studio 2022. When i build the code in the IDE I get endless warnings about unassigned fields. Mostly in unity’s own code. I would like to suppress these warnings. I have created a file .editorconfig in the root of my project looking like this:

[*.{cs,vb}]
dotnet_diagnostic.IDE0649.severity = none

According to what I read this is supposed to hide those warnings. Sadly it has no effect. What is the solution?

To my knowledge, VS should suppress warnings on code that conforms to Unity convention. At least it shouldn’t warn about fields that are public or marked with [SerializeField].

But then I concern about the exact meaning of this phrase - does it mean the warnings that were spit out when you used the Build function from VS, or the warning waves under the field declaration? Or both, maybe?

For the records, it is CS0649 that you’re interested in, not IDE0649.

Though I do have .editorconfig in my project, but I don’t have to declare CS0649.severity, reason is as above.

I use Rider, the only warning I get repeatedly from Unity package code is CS8021 (no value for RuntimeMetadataVersion ..).

If the .editorconfig won’t work, create a csc.rsp file under Assets/ and put this in there, one for every warning type (just the number suffices).

-nowarn:0414
-nowarn:0649

The response file is a general compiler thing, so you will find help outside of Unity-specifics on this. You can do more with this, like defining preprocessor symbols for all platforms so you needn’t edit them separately for each platform in project settings (Player).

Thanks Laicasaane. I was using the wrong warning ID. I mistakenly thought I had to put IDE at the front of all warning codes.

These warning were appearing in VS itself not unity. I was getting them in unity’s AI & Input packages.

Thanks CodeSmile. Good tip about the csc.rsp file. Haven’t tried out rider, I’ll have to give it a go.

Yes, I know you were telling about VS. I’m just not sure if you meant entries from the Error List panel

or waves under your fields?

Because you can ignore the former. And it’s strange if the latter happens.