> ## Documentation Index
> Fetch the complete documentation index at: https://dotnetdocs.com/llms.txt
> Use this file to discover all available pages before exploring further.

# AddCommand

> Command-line tool for creating and adding a documentation project to a solution file.

## Definition

**Assembly:** CloudNimble.DotNetDocs.Tools.dll

**Namespace:** CloudNimble.DotNetDocs.Tools.Commands

**Inheritance:** CloudNimble.DotNetDocs.Tools.Commands.Base.DocsCommandBase

## Syntax

```csharp theme={"dark"}
CloudNimble.DotNetDocs.Tools.Commands.AddCommand
```

## Summary

Command-line tool for creating and adding a documentation project to a solution file.

## Remarks

This command creates a .docsproj file configured for the specified documentation type (defaults to Mintlify)
and adds it to the specified solution file (.sln or .slnx). The project is automatically added to a "Docs" solution folder.
For .slnx files, the command post-processes the XML to add Type="C#" attributes to .docsproj nodes.

## Constructors

### <Icon icon="hammer" iconType="duotone" color="#419AC5" size={24} className="mr-2" /> .ctor

#### Syntax

```csharp theme={"dark"}
public AddCommand()
```

### <Icon icon="hammer" iconType="duotone" color="#419AC5" size={24} className="mr-2" /> .ctor <Badge color="gray">Inherited</Badge>

<Note>Inherited from `CloudNimble.DotNetDocs.Tools.Commands.Base.DocsCommandBase`</Note>

#### Syntax

```csharp theme={"dark"}
public DocsCommandBase()
```

### <Icon icon="hammer" iconType="duotone" color="#419AC5" size={24} className="mr-2" /> .ctor <Badge color="gray">Inherited</Badge>

<Note>Inherited from `object`</Note>

#### Syntax

```csharp theme={"dark"}
public Object()
```

## Properties

### <Icon icon="tag" iconType="duotone" color="#419AC5" size={24} className="mr-2" /> DocumentationType

Gets or sets the documentation type for the project.

#### Syntax

```csharp theme={"dark"}
public string DocumentationType { get; set; }
```

#### Property Value

Type: `string?`

### <Icon icon="tag" iconType="duotone" color="#419AC5" size={24} className="mr-2" /> OutputDirectory

Gets or sets the output directory for the generated documentation project.

#### Syntax

```csharp theme={"dark"}
public string OutputDirectory { get; set; }
```

#### Property Value

Type: `string?`

### <Icon icon="tag" iconType="duotone" color="#419AC5" size={24} className="mr-2" /> ProjectName

Gets or sets the name of the documentation project.

#### Syntax

```csharp theme={"dark"}
public string ProjectName { get; set; }
```

#### Property Value

Type: `string?`

#### Remarks

If not specified, the project name defaults to the solution name.

### <Icon icon="tag" iconType="duotone" color="#419AC5" size={24} className="mr-2" /> SkipSolution

Gets or sets whether to skip adding the project to the solution file.

#### Syntax

```csharp theme={"dark"}
public bool SkipSolution { get; set; }
```

#### Property Value

Type: `bool`

### <Icon icon="tag" iconType="duotone" color="#419AC5" size={24} className="mr-2" /> SolutionPath

Gets or sets the path to the solution file (.sln or .slnx) to use.

#### Syntax

```csharp theme={"dark"}
public string SolutionPath { get; set; }
```

#### Property Value

Type: `string?`

### <Icon icon="tag" iconType="duotone" color="#419AC5" size={24} className="mr-2" /> UsePrerelease

Gets or sets whether to use the latest prerelease version of the DotNetDocs.Sdk.

#### Syntax

```csharp theme={"dark"}
public bool UsePrerelease { get; set; }
```

#### Property Value

Type: `bool`

## Methods

### <Icon icon="code-fork" iconType="duotone" color="#419AC5" size={24} className="mr-2" /> Equals <Badge color="gray">Inherited</Badge> <Badge color="orange">Virtual</Badge>

<Note>Inherited from `object`</Note>

#### Syntax

```csharp theme={"dark"}
public virtual bool Equals(object obj)
```

#### Parameters

| Name  | Type      | Description |
| ----- | --------- | ----------- |
| `obj` | `object?` | -           |

#### Returns

Type: `bool`

### <Icon icon="thumbtack" iconType="duotone" color="#419AC5" size={24} className="mr-2" /> Equals <Badge color="gray">Inherited</Badge>

<Note>Inherited from `object`</Note>

#### Syntax

```csharp theme={"dark"}
public static bool Equals(object objA, object objB)
```

#### Parameters

| Name   | Type      | Description |
| ------ | --------- | ----------- |
| `objA` | `object?` | -           |
| `objB` | `object?` | -           |

#### Returns

Type: `bool`

### <Icon icon="code-fork" iconType="duotone" color="#419AC5" size={24} className="mr-2" /> GetHashCode <Badge color="gray">Inherited</Badge> <Badge color="orange">Virtual</Badge>

<Note>Inherited from `object`</Note>

#### Syntax

```csharp theme={"dark"}
public virtual int GetHashCode()
```

#### Returns

Type: `int`

### <Icon icon="thumbtack" iconType="duotone" color="#419AC5" size={24} className="mr-2" /> GetLatestSdkVersionAsync <Badge color="gray">Inherited</Badge>

<Note>Inherited from `CloudNimble.DotNetDocs.Tools.Commands.Base.DocsCommandBase`</Note>

Queries NuGet.org for the latest version of the DotNetDocs.Sdk package.

#### Syntax

```csharp theme={"dark"}
protected static System.Threading.Tasks.Task<string> GetLatestSdkVersionAsync(bool includePrerelease)
```

#### Parameters

| Name                | Type   | Description                                           |
| ------------------- | ------ | ----------------------------------------------------- |
| `includePrerelease` | `bool` | Whether to include prerelease versions in the search. |

#### Returns

Type: `System.Threading.Tasks.Task<string?>`
The latest version string, or null if the query fails.

### <Icon icon="function" iconType="duotone" color="#419AC5" size={24} className="mr-2" /> GetType <Badge color="gray">Inherited</Badge>

<Note>Inherited from `object`</Note>

#### Syntax

```csharp theme={"dark"}
public System.Type GetType()
```

#### Returns

Type: `System.Type`

### <Icon icon="thumbtack" iconType="duotone" color="#419AC5" size={24} className="mr-2" /> GetVersion <Badge color="gray">Inherited</Badge>

<Note>Inherited from `CloudNimble.DotNetDocs.Tools.Commands.Base.DocsCommandBase`</Note>

Gets the version string for the tool.

#### Syntax

```csharp theme={"dark"}
internal static string GetVersion()
```

#### Returns

Type: `string`
The version string.

### <Icon icon="function" iconType="duotone" color="#419AC5" size={24} className="mr-2" /> MemberwiseClone <Badge color="gray">Inherited</Badge>

<Note>Inherited from `object`</Note>

#### Syntax

```csharp theme={"dark"}
protected internal object MemberwiseClone()
```

#### Returns

Type: `object`

### <Icon icon="function" iconType="duotone" color="#419AC5" size={24} className="mr-2" /> OnExecute

Executes the command to create and add a documentation project to the specified solution.

#### Syntax

```csharp theme={"dark"}
public System.Threading.Tasks.Task<int> OnExecute(McMaster.Extensions.CommandLineUtils.CommandLineApplication app)
```

#### Parameters

| Name  | Type                                                          | Description                                                                                   |
| ----- | ------------------------------------------------------------- | --------------------------------------------------------------------------------------------- |
| `app` | `McMaster.Extensions.CommandLineUtils.CommandLineApplication` | The command-line application context used to access command-line arguments and configuration. |

#### Returns

Type: `System.Threading.Tasks.Task<int>`
A task that represents the asynchronous operation. The task result is 0 if the documentation project is
created and added successfully; otherwise, 1.

#### Remarks

If the solution file is not specified, the method attempts to locate one in the
current directory. The documentation project is created in the specified output directory or, if not
provided, in a default location based on the solution file. Any errors encountered during execution are
reported to the console, and a nonzero exit code is returned.

### <Icon icon="thumbtack" iconType="duotone" color="#419AC5" size={24} className="mr-2" /> ReferenceEquals <Badge color="gray">Inherited</Badge>

<Note>Inherited from `object`</Note>

#### Syntax

```csharp theme={"dark"}
public static bool ReferenceEquals(object objA, object objB)
```

#### Parameters

| Name   | Type      | Description |
| ------ | --------- | ----------- |
| `objA` | `object?` | -           |
| `objB` | `object?` | -           |

#### Returns

Type: `bool`

### <Icon icon="code-fork" iconType="duotone" color="#419AC5" size={24} className="mr-2" /> ToString <Badge color="gray">Inherited</Badge> <Badge color="orange">Virtual</Badge>

<Note>Inherited from `object`</Note>

#### Syntax

```csharp theme={"dark"}
public virtual string ToString()
```

#### Returns

Type: `string?`

### <Icon icon="thumbtack" iconType="duotone" color="#419AC5" size={24} className="mr-2" /> WriteHeader <Badge color="gray">Inherited</Badge>

<Note>Inherited from `CloudNimble.DotNetDocs.Tools.Commands.Base.DocsCommandBase`</Note>

Writes the DotNetDocs CLI header to the console with colorful ASCII art and version information.

#### Syntax

```csharp theme={"dark"}
public static void WriteHeader()
```

#### Remarks

This method displays a multi-line ASCII art logo combining the DotNetDocs branding with
version and attribution information. The output uses console colors to create an eye-catching
header for CLI operations.
