Visual Studio: temporarily disable StyleCop

前端 未结 5 1913
忘了有多久
忘了有多久 2021-02-19 08:27

Can you disable styleCop in VS?

Scenario:

  1. Press \"Disable StyleCop\" button
  2. Run/debug some test code
  3. The button automatically, enable Sty
5条回答
  •  星月不相逢
    2021-02-19 09:31

    I've setup a separate build configuration that doesn't run code analysis.

    I now have the following configurations in VS:

    • Release
    • Debug
    • Debug (No code analysis)

    You have to manually choose which configuration you want to build (i.e. step 3 in your list would be a manual step)

    In the build targets file I've included code along these lines:

    
        true
    
    
    
        true
    
    
    
        false
    
    
    
        CODE_ANALYSIS;$(DefineConstants)
    
    

提交回复
热议问题