PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Tuesday, April 26, 2022

[FIXED] How to remove Visual Studio 'IDE' warnings for a Unity project?

 April 26, 2022     c#, unity3d, visual-studio, warnings     No comments   

Issue

I've been trying to get rid off IDE warnings for a Unity project:

While csc.rsp works for CS warnings, it doesn't for IDE warnings:

-nowarn:CS0649,IDE0063,IDE0071

Question:

How to remove IDE warnings for a Unity project?


Solution

Here's the simplest and most straightforward approach:

(for suppressing warnings solution-wide)

  • no need to use CodeAnalysisRuleSet
  • no need to use AssetPostprocessor nor ProjectFilesGenerator
    • both being error-prone and unfriendly as one can be

Instead,

.editorconfig

Visual Studio 2019 is smart enough to pick it up and apply it to all projects:

[*.{cs,vb}]

# IDE0051 Private member is unused.
dotnet_diagnostic.IDE0051.severity = none

If you need more granularity, add specific .editorconfig files at projects that needs different rules.

Of course you lose the GUI editing aspect but it isn't really a stopper in my case.



Answered By - aybe
Answer Checked By - David Goodson (PHPFixing Volunteer)
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing