<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>

CC BY-SA 4.0
2020-07-07T15:04:14.097Z
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.
Peter
CC BY-SA 4.0
2020-07-10T08:05:59.143Z
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...
Domagoj
<tfs>
In TFS how to check a C# source code base for wrong usage of static variables or methods in multithreaded code before build
Domagoj
# 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

