Search Unity

Question Using stylecops both in Unity an Visual studio

Discussion in 'Testing & Automation' started by kasmurdanto, Sep 9, 2023.

  1. kasmurdanto

    kasmurdanto

    Joined:
    Jun 6, 2019
    Posts:
    10
    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 : https://docs.unity3d.com/Manual/roslyn-analyzers.html

    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.
     
  2. CodeSmile

    CodeSmile

    Joined:
    Apr 10, 2014
    Posts:
    5,797
    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.
     
  3. kasmurdanto

    kasmurdanto

    Joined:
    Jun 6, 2019
    Posts:
    10
    @CodeSmile The issue was with the version of VS I used, with VS 2022 it works as expected.
     
    CodeSmile likes this.