Infer# brings Facebook’s Infer analyzer to C#
Microsoft has introduced Infer#, a new static analyzer that brings the Infer analysis platform to C# developers. The tool already detects null-pointer dereferences and resource leaks through bi-abduction analysis, with race condition detection based on RacerD analysis currently in development. Infer# has been used internally at Microsoft on projects including Roslyn, DotNET SDK, ASP.NET Core, and MSBuild.
The tool was first presented at the Infer Practitioners workshop, held alongside PLDI 2020.
How it works
Infer# adds a new language front end for C# to Infer. This front end acts as a compiler that translates .NET bytecode into Infer’s intermediate language, SIL. Because Infer’s analyses operate on SIL rather than the source language itself, they can be reused for C# with minimal adaptation. The project also adds a language-independent JSON layer for representing SIL, which could simplify the creation of additional Infer front ends for other programming languages in the future.
Why it matters
While several open source static analyzers already exist for C#, most cannot find deep inter-procedural bugs—such as null dereferences, data races, and resource leaks—that Infer can detect in languages like Java and C++. Infer# extends these scalable, automated, and interprocedural analyses to the .NET platform. The tool is available on GitHub.



