As mentioned in the title I'm using Visual Studio Community 2022 17.6.4 for Unity C# development, however I can no longer get Code Analysis to provide suggestions, warnings, nor errors. When I run Code Analysis, it runs, but there are no results. When I perform a build, none of the code issues are flagged.
I've tried creating a fresh default URP project in Unity 2022.3.4, added the below simple script which breaks some of the Unity rules, but code analysis is not flagging it. IntelliSense shows me there is an issue if I select the specific lines, but I want to analyze my entire solution.
I've verified that my assembly references include Microsoft.Unity.Analyzers, using default settings. I've also tried creating an editorconfig file, but no luck.
All of this was working not too long ago and I'm not sure at what point it stopped working. I tried rolling back to 17.6.2 but no different. I then fully uninstalled and reinstalled VS Community 17.6.4 and reset all setting to default, but still no luck.
using UnityEngine; [RequireComponent(typeof(Rigidbody))] public class TestBehavior : MonoBehaviour { void Start() { } void Update() { Rigidbody body = GetComponent<Rigidbody>(); if (gameObject.tag == body.gameObject.tag) { Debug.Log("TEST " + Time.fixedDeltaTime); } } }