# MarkdownString

- Kind: `class`
- Package: [Aspire.Hosting](/reference/api/csharp/aspire.hosting.md)
- Version: `13.3.0`
- Namespace: `Aspire.Hosting.Pipelines`
- Target framework: `net8.0`
- Source: [GitHub](https://github.com/microsoft/aspire/blob/bd20f904cde09ecb9c9ae5116a6f13614bf2d7c2/src/Aspire.Hosting/Pipelines/MarkdownString.cs)

Represents a string that contains Markdown-formatted content.

## Definition

```csharp
namespace Aspire.Hosting.Pipelines;

public sealed class MarkdownString
{
    // ...
}
```

## Remarks

Use this type to explicitly indicate that a string value should be interpreted as Markdown when displayed in pipeline output. APIs that accept both `String` and [MarkdownString](/reference/api/csharp/aspire.hosting/markdownstring.md) will render Markdown formatting (such as bold, links, and lists) only when a [MarkdownString](/reference/api/csharp/aspire.hosting/markdownstring.md) is provided; plain `String` values are displayed as-is without Markdown processing.

## Constructors

- [MarkdownString(string)](/reference/api/csharp/aspire.hosting/markdownstring/constructors.md#constructor-string) -- Initializes a new instance of the [MarkdownString](/reference/api/csharp/aspire.hosting/markdownstring.md) class with the specified Markdown content.

## Properties

- [Value](/reference/api/csharp/aspire.hosting/markdownstring/properties.md#value) : `string` `get` -- Gets the Markdown-formatted string value.

## Methods

- [ToString](/reference/api/csharp/aspire.hosting/markdownstring/methods.md#tostring) : `string` -- Returns a string that represents the current object.

## Examples

```csharp
// Log a message with Markdown formatting
step.Log(LogLevel.Information, new MarkdownString("Deployed **myapp** to [endpoint](https://example.com)"));

// Add a Markdown-formatted value to the pipeline summary
summary.Add("Key", new MarkdownString($"[{name}]({url})"));
```
