> For the complete documentation index, see [llms.txt](https://brightercommand.gitbook.io/paramore-brighter-documentation/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://brightercommand.gitbook.io/paramore-brighter-documentation/brighter-configuration/analyzersupport.md).

# Analyzer Support

Brighter provides Roslyn analyzers that detect common configuration and message-mapping mistakes while you write and build your application.

> **Reference** · Applies to **Brighter V10**

Brighter provides Roslyn analyzers that detect common configuration and message-mapping mistakes while you write and build your application. The analyzers surface these problems as IDE and compiler warnings, before they can become runtime errors or subtle production behavior.

## Installing the Analyzer

Add the Brighter analyzer NuGet package to each project that creates Brighter publications, subscriptions, or message mappers:

```shell
dotnet add package Paramore.Brighter.Analyzer.Package
```

The analyzer assembly loads automatically for the project. You do not need to register the analyzer in your Brighter configuration.

## Diagnostic Reference

| ID         | Severity | Detects                                                            |
| ---------- | -------- | ------------------------------------------------------------------ |
| **BRT001** | Warning  | A `Publication` is created without assigning `RequestType`.        |
| **BRT002** | Warning  | The type assigned to `RequestType` does not implement `IRequest`.  |
| **BRT003** | Warning  | A `Subscription` is created without specifying `MessagePumpType`.  |
| **BRT004** | Warning  | A wrap attribute is applied to the wrong message-mapper method.    |
| **BRT005** | Warning  | An unwrap attribute is applied to the wrong message-mapper method. |

## Suppressing an Analyzer Diagnostic

Where you have a reason to keep the code as it is, suppress the diagnostic as narrowly as you can. Use a pragma around the code it applies to:

```csharp
using Paramore.Brighter;

#pragma warning disable BRT001 // say here why this publication has no RequestType
var publication = new Publication
{
    Topic = new RoutingKey("orders.created")
};
#pragma warning restore BRT001
```

Or set its severity in `.editorconfig`, which applies to every file the section matches:

```ini
dotnet_diagnostic.BRT001.severity = none
```

Prefer the pragma, with a comment saying why, over disabling a diagnostic for a whole project.

## Further Reading

* [Message Mappers](/paramore-brighter-documentation/using-an-external-bus/messagemappers.md) — the wrap and unwrap attributes BRT004 and BRT005 check
* Reference code: `Brighter/src/Paramore.Brighter.Analyzer/Analyzers/PublicationRequestTypeAssignmentAnalyzer.cs`
* Reference code: `Brighter/src/Paramore.Brighter.Analyzer/Analyzers/SubscriptionConstructorAnalyzer.cs`
* Reference code: `Brighter/src/Paramore.Brighter.Analyzer/Analyzers/WrapAttributeAnalyzer.cs`


---

# 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://brightercommand.gitbook.io/paramore-brighter-documentation/brighter-configuration/analyzersupport.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
