# How to analyze a .NET project in SonarQube when the code has errors?

**URL:** <https://community.sonarsource.com/t/how-to-analyze-a-net-project-in-sonarqube-when-the-code-has-errors/140864>\
**Category:** SonarQube Server / Community Build\
**Tags:** csharp, sonarqube, dotnet, sonarqube-ide, scanner\
**Created:** [May 10, 2025, 5:22pm UTC](https://community.sonarsource.com/t/how-to-analyze-a-net-project-in-sonarqube-when-the-code-has-errors/140864 "2025-05-10T17:22:26Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Tadas\_Baltrunas](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/tadas_baltrunas/32/69281_2.png) [@Tadas\_Baltrunas](https://community.sonarsource.com/u/Tadas_Baltrunas)\
**Post date:** [May 10, 2025, 5:22pm UTC](https://community.sonarsource.com/t/how-to-analyze-a-net-project-in-sonarqube-when-the-code-has-errors/140864/1 "2025-05-10T17:22:26Z")

</div>

Hi,  
I’m working on a research project where I need to analyze code quality using SonarQube Community Build. I have a large number of individual C# methods (around 300+) extracted from various open-source projects. These methods are placed into a .NET project, but many of them are incomplete — they rely on missing types, external references, or other parts of the original codebase.

As a result, the project cannot compile and shows over 1000 errors (missing classes, methods, extension class structure issues, etc.). However, I still want SonarQube to scan all files and provide as much static analysis as possible, even if the code is broken.

Is there a way to tell SonarQube to analyze all `.cs` files regardless of build errors?

---

<div class="post-metadata">

**Author:** ![ganncamp](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/ganncamp/32/1261_2.png) [@ganncamp](https://community.sonarsource.com/u/ganncamp)\
**Post date:** [May 12, 2025, 12:34pm UTC](https://community.sonarsource.com/t/how-to-analyze-a-net-project-in-sonarqube-when-the-code-has-errors/140864/2 "2025-05-12T12:34:21Z")

</div>

Hi,

Welcome to the community!

For C#, the rules run _during_ the build. You’ll have to fix the build in order to analyze.

&nbsp;  
Ann
