Questions tagged [microsoft-code-analysis]
9 questions
1
vote
2 answers
C++ compiler waring C26409 - avoid calling new and delete
Here is my code that I'm getting (Warning C26409 Avoid calling new and delete explicitly, use std::make_unique instead (r.11).) after doing a Visual Studio 2019 Code Analysis:
#include
#include
int main()
{
auto *sResult…

JeffR
- 765
- 2
- 8
- 23
0
votes
0 answers
Could not load file or assembly 'System.Collections.Immutable'
I'm running a dot net core 6 api project where i use the roslyn library Microsoft.CodeAnalysis to format some text to C# code.
in local test everyting work perfectly, but when i publish on IIS, the function that uses the Microsoft.CodeAnalysis…

mohamed souilmi
- 81
- 1
- 8
0
votes
0 answers
How do code analysis, AST generation and SARIF report work in MSBuild?
Recently, I became curios about mechanism of code analysis in MSBuild. I searched a lot, specially in MSDN but could not get a firm grasp on how exactly this process is done.
I want to know what components or classes, in what order, are responsible…

noone
- 1
- 1
0
votes
0 answers
How to generate the Microsoft code analysis xml file in a Visual C++ project?
I have created c++ project from visual studio 2019 and ran below syntax from command prompt. But log file was not generated. How to generate the Microsoft code analysis xml file in a Visual C++ project?
msbuild /t:Rebuild /p:Configuration=Release…

Chaya
- 137
- 11
0
votes
0 answers
How to convert FxCopReport format in sarif format?
Running microsoft code analysis using MSBUILD creates xml file which is in FxCopReport format. How canit be converted in sarif format ?

Chaya
- 137
- 11
0
votes
0 answers
How to run fxcop code analysis on c# visual studio project?
I created WPF App(.Net Framwork project) using c# language.
Added sample code.
Than ran Run code analysis. Below are the error list
By default it ran using roslyn code analysis tool, But i want it to run using fxcop code analysis tool
How to run…

Chaya
- 137
- 11
0
votes
0 answers
Referencing Cross project compilation within custom DiagnosticAnalyzer - Microsoft.CodeAnalysis.CSharp
Can anyone let me know about any way we can access cross project compilation (in same solution) inside custom DiagnosticAnalyzer.
I need to analyze value of an argument for a particular method invocations. This argument could be a field from source…

vda
- 1
0
votes
2 answers
Is there a way to enable "Implicit Usings" feature when compiling code with .NET Compiler SDK?
The "ImplicitUsings" feature allows code to omit usings statements for standard namespaces. I need to analyze a random source file(s) for which I may not know an appropriate set of includes. In C# 10 a standard set of namespaces could be included…

Mark Meyerovich
- 193
- 3
- 9
0
votes
1 answer
Use StyleCop.Analyzers, Microsoft.CodeAnalysis.* or both?
What is the difference between them from the point of view of the rules? Are the rule sets close enough to just use one of them? Then which one to choose?

marcin_
- 41
- 5