Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Microsoft Unity Analyzers aren't applied when building from Visual Studio?

Discussion in 'Scripting' started by sfallier_scopely, Nov 18, 2020.

  1. sfallier_scopely

    sfallier_scopely

    Joined:
    Aug 24, 2020
    Posts:
    7
    I was looking for a way to suppress warnings related to serialized fields not be initialized, and found that this exists in the form of Microsoft Unity Analyzers, and supposedly ships as part of the Unity tools for Visual Studio. Which lead me to realize that I don't get any of the warnings when the Unity editor compiles the scripts - I'm assuming because it's using the analyzers, but maybe there's some other magic going on there.

    Is there some way to get the identical warning filtering (and ideally, propagating the warnings-as-errors setting) into the generated Visual Studio projects? I'd really like to get the same results when compiling code in VS as I get when the Unity editor does a compilation.
     
  2. sfallier_scopely

    sfallier_scopely

    Joined:
    Aug 24, 2020
    Posts:
    7
    Hmm, went poking around in some other threads related to the warnings and apparently the docs for the Analyzers are lying about it being deployed in Unity already.