Using stylecops both in Unity an Visual studio

Hello, does someone has experience with using analysers with both Unity and an IDE ? Here’s where I am at, installing an analyser following this doc is working well for showing warnings in Unity’s console : Unity - Manual: Roslyn analyzers and source generators

But my issue is, I’d like the warnings to also appear in my IDE (Visual Studio 2022). I tried installing the Nugets package for stylecops, it’s installed but doesn’t show up any errors. Do I need to do any other configuration ? My understanding is that I would need to build the project (inside VS), but I can’t since it’s a Unity project… I’m confused, please help.

Build Project/Solution should work if you run it in the IDE. It won’t create an executable build, but it’ll compile all the scripts into DLLs.

@CodeSmile The issue was with the version of VS I used, with VS 2022 it works as expected.

1 Like