Body: <p>We have a huge base of code from an .NET Desktop ERP, database access layers are now being used for web projects, so we experienced multithreading issues because of static variables. 
  For now I would like to check 2 cases (feel free to recomend more) : </p>
  
  <ol>
  <li>does a static method uses any variables outside of stack scoped variables</li>
  <li>does non-static method uses static variables</li>
  </ol>
  
Comments: CC BY-SA 4.0
Comments: 2020-07-07T15:04:14.097Z
Comments: This really isn't a DevOps problem. You might want to pose this question on StackOverflow since it's more about code style analysis (fxCop or similar tool). Whatever tool you use to do this can then be incorporated into your ci/cd pipeline.
Comments: Peter
Comments: CC BY-SA 4.0
Comments: 2020-07-10T08:05:59.143Z
Comments: I agree , but question was banned at StackOverflow with reason that they cant offer suggesions for which tools to use because that would be marketing...I know I have FXcop and looked into it an other analyzers but cant fins exactly this rule, maybe make it with Roslyn etc...
Comments: Domagoj
Tags: <tfs>
Title: In TFS how to check a C# source code base for wrong usage of static variables or methods in multithreaded code before build
UserDisplayName: Domagoj
ThreadText: # In TFS how to check a C# source code base for wrong usage of static variables or methods in multithreaded code before build
  
  (Asked by: username_0 on 2019-12-24)
  
  We have a huge base of code from an .NET Desktop ERP, database access layers are now being used for web projects, so we experienced multithreading issues because of static variables.
  For now I would like to check 2 cases (feel free to recomend more) :
  
  1. does a static method uses any variables outside of stack scoped variables
  2. does non-static method uses static variables
  
  **Tags:** tfs
  
  > **Comments:**
  > **username_1**: This really isn't a DevOps problem. You might want to pose this question on StackOverflow since it's more about code style analysis (fxCop or similar tool). Whatever tool you use to do this can then be incorporated into your ci/cd pipeline.  
  > **username_0**: I agree , but question was banned at StackOverflow with reason that they cant offer suggesions for which tools to use because that would be marketing...I know I have FXcop and looked into it an other analyzers but cant fins exactly this rule, maybe make it with Roslyn etc...  
  
  ---
  
  ## 0 answers
  
  