> For the complete documentation index, see [llms.txt](https://docs.sonarsource.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.sonarsource.com/sonarqube-server/analyzing-source-code/languages/vb-dotnet.md).

# VB.NET

## Supported versions <a href="#supported-versions" id="supported-versions"></a>

The level of support for a language is defined as follows:

* Fully supported: Analysis will complete. All the language features are understood and examined.
* Supported: Most language features are understood and examined but the version includes unsupported features. Analysis might break or provide incomplete results.

Versions 7 to 16 are fully supported.

## Supported frameworks and tools <a href="#supported-frameworks-and-tools" id="supported-frameworks-and-tools"></a>

ASP.NET MVC, ASP.NET Core MVC

## Language-specific properties <a href="#language-specific-properties" id="language-specific-properties"></a>

Discover and update the VB.NET-specific [Analysis parameters](/sonarqube-server/analyzing-source-code/analysis-parameters.md) by going to **Administration** > **Configuration** > **General Settings** > **Languages** > **VB.NET**

### Analyze generated code <a href="#analyze-generated-code" id="analyze-generated-code"></a>

To analyze tool-generated code (e.g. WCF code generated by `SvcUtil.exe`) for a specific VB.NET project, enable the "Analyze generated code" setting inside **Project settings** > **General Settings** > **Languages** > **VB.NET**. By default, tool-generated code files are skipped from the analysis.

The detection of generated code is based on file name, special comments, and attributes. The currently recognized values are in [GeneratedCodeRecognizer.cs](https://github.com/SonarSource/sonar-dotnet/blob/master/analyzers/src/SonarAnalyzer.Core/Syntax/Utilities/GeneratedCodeRecognizer.cs).

{% hint style="info" %}
When a `Generated` comment is present in the file, SonarQube ignores the *entire* \*\* *file*, even if only parts of it were generated. It’s possible to enable or disable analysis of *files containing generated code* at the instance or project level in **General Settings** > **Languages** > *Your language* > **Analyze generated code**.
{% endhint %}

## Scanner compatibility <a href="#scanner-compatibility" id="scanner-compatibility"></a>

To analyze VB.NET code, you need to use the [SonarScanner for .NET](/sonarqube-server/analyzing-source-code/scanners/dotnet.md) version 4.x or newer.

## Exclusions <a href="#exclusions" id="exclusions"></a>

Files to be excluded should be set in the project configuration. Excluded files are still going to be analyzed during the compilation and the results will be filtered according to the exclusion settings.

As an alternative, an `.editorconfig` file can be used to disable the analysis for a specific rule on a file or directory. This can solve performance problems on large files.

`[Path/File.vb]`\
`dotnet_diagnostic.Sxxx.severity = none`

## In-line suppression of issues <a href="#in-line-suppression-of-issues" id="in-line-suppression-of-issues"></a>

Standard Roslyn-based suppression mechanisms are available as shown below.

### Pragma suppression

```csharp
#pragma warning disable S2094 // Classes should not be empty S2094
public class Empty { }
#pragma warning restore S2094 // Classes should not be empty S2094
```

### Local SuppressMessage attribute

```csharp
[SuppressMessage("Major Code Smell", "S2094:Classes should not be empty", Justification = "Because ...")]
public class Empty { }
```

### Global SuppressMessage attribute

```csharp
// Global Suppression attribute
[assembly: SuppressMessage("Major Code Smell", "S2094:Classes should not be empty", Justification = "Because..", Scope = "member", Target = "~P:SonarAnalyzer.Core.AnalysisContext.Empty.Value")]
```

### Using Visual Studio

The automatic generation of all three suppression mechanisms is supported by standard Visual Studio experience out of the box.

<figure><img src="/spaces/KXW79zfYFiA8incTvwZK/files/QlLYo1UbqLeqURMSeWzh" alt="Select Suppress or configure issues in the Fix contextual menu."><figcaption></figcaption></figure>

### Using SonarQube for Visual Studio

The Pragma suppression mechanism is supported by SonarQube for Visual Studio.

<div align="left"><figure><img src="/spaces/KXW79zfYFiA8incTvwZK/files/6ec55xNCJHDhcIuzFve3" alt="Select the Suppress menu."><figcaption></figcaption></figure></div>

## Known limitations <a href="#known-limitations" id="known-limitations"></a>

Currently, an error will be thrown when an issue is raised on a line of code containing the following pattern `\s+error\s*:` (i.e. one or more spaces, the string ‘error’, zero or more spaces and a ‘:’ ). This is a well known problem on the Microsoft side (see [issue](https://github.com/dotnet/roslyn/issues/5724/)). In order to work around this problem, analysis will skip issues reported on any line where the pattern is detected.

## Related Pages <a href="#related-pages" id="related-pages"></a>

* [External analyzer reports](/sonarqube-server/analyzing-source-code/importing-external-issues/external-analyzer-reports.md) (VSTest, NUnit, MSTest, xUnit)
* [External analyzer reports](/sonarqube-server/analyzing-source-code/importing-external-issues/external-analyzer-reports.md) (See "Notes on external .NET issues")
* [Overview](/sonarqube-server/analyzing-source-code/test-coverage/overview.md) (Visual Studio Code Coverage, dotCover, OpenCover, Coverlet, Altcover)
* [Introduction](/sonarqube-server/analyzing-source-code/scanners/dotnet/introduction.md)
* [Azure DevOps Extension](/sonarqube-server/analyzing-source-code/scanners/sonarqube-extension-for-azure-devops.md)
* [Analysis of product projects vs. test projects](https://github.com/SonarSource/sonar-scanner-msbuild/wiki/Analysis-of-product-projects-vs.-test-projects)
* [Troubleshooting guide for .NET code coverage import](https://community.sonarsource.com/t/37151)
* [Investigating the performance of .NET Analysis](https://community.sonarsource.com/t/47279)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.sonarsource.com/sonarqube-server/analyzing-source-code/languages/vb-dotnet.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
