AspNetCore.Docs/aspnetcore/diagnostics/asp0017.md

39 lines
851 B
Markdown

---
title: "ASP0017: Invalid route pattern"
description: "Learn about analysis rule ASP0017: Invalid route pattern"
author: tdykstra
monikerRange: '>= aspnetcore-8.0'
ms.author: tdykstra
ms.date: 11/22/2022
uid: diagnostics/asp0017
---
# ASP0017: Invalid route pattern
| | Value |
|-|-|
| **Rule ID** |ASP0017|
| **Category** |Usage|
| **Fix is breaking or non-breaking** |Non-breaking|
## Cause
A route pattern is invalid.
## Rule description
This diagnostic is emitted when a route pattern is invalid. In the example below, the route pattern contains an invalid token.
```csharp
var app = WebApplication.Create();
app.MapGet("/{id", (int id) => ...);
```
## How to fix violations
To fix a violation of this rule, correct the error identified in the analyzer message.
## When to suppress warnings
Do not suppress a warning from this rule.