---
title: C#
slug: v4-6/get-started/install-guides/c-sharp
icon: {"faIcon":"fa-brands fa-uikit"}
docTags: 
createdAt: 2023-07-28T03:48:24.723Z
---

You can integrate the Ditto SDK into C# projects to develop for a wide range of platforms, including mobile apps for iOS and Android, desktop apps, Linux-enabled server systems, and more.

:::hint{type="info"}
For a complete overview of the platforms, transports, and devices the C# SDK supports, see [C#](docId\:Ygqxn2pPL_g-WqfUu25I8).
:::

To install the C# SDK:

::::WorkflowBlock
:::WorkflowBlockItem
Confirm that you meet the minimum requirements. ([Prerequisites](docId\:JKjoOHAyI8TIZ7V__d9aF))
:::

:::WorkflowBlockItem
Prepare your environment for Ditto. ([Setting Up Your Environment](docId\:JKjoOHAyI8TIZ7V__d9aF))
:::

:::WorkflowBlockItem
Set up your app permissions. ([Setting Up Permissions](docId\:wOPd6FCngXjdeKKzdwXmE))
:::

:::WorkflowBlockItem
Add Ditto to your app. ([Integrating Ditto](docId\:JKjoOHAyI8TIZ7V__d9aF))
:::
::::

# Prerequisites

Following are the minimum requirements that must be met before attempting to install Ditto.

- [.NET Standard 2.1](https://learn.microsoft.com/en-us/dotnet/standard/net-standard?tabs=net-standard-2-1#net-standard-versions)&#x20;
- [.NET Core 3](https://dotnet.microsoft.com/en-us/download/dotnet/3.0)&#x20;
- [.NET Framework 4.0](https://dotnet.microsoft.com/en-us/download/dotnet-framework/net40)

# Installing Ditto

Using either a compatible package manager, the .NET CLI, or by adding a reference to the package: `CSProj.xml` file, install the Ditto SDK by doing any of the following:

:::hint{type="info"}
If using a package manager other than NuGet, the official package manager for .NET, the command syntax to install Ditto may differ from the following snippet. For more information, see the official Nuget documentation > [Ditto .NET Standard](https://www.nuget.org/packages/Ditto/)
:::

:::CodeblockTabs
Package Manager

```none
Install-Package Ditto -Version 4.3.0
```

.NET CLI

```none
dotnet add package Ditto --version 4.3.0
```

Package Reference

```none
<PackageReference Include="Ditto" Version="4.3.0" />
```
:::

# Initializing Ditto

Once you’ve installed the Ditto SDK, set the debug level you want Ditto to log messages for, create a new Ditto identity, and set up Ditto exception handling for data sync operations:&#x20;

```csharp
try
{
    DittoLogger.SetMinimumLogLevel(DittoLogLevel.Debug);
    var ditto = new Ditto(DittoIdentity.OnlinePlayground("REPLACE_ME_WITH_YOUR_APP_ID", "REPLACE_ME_WITH_YOUR_PLAYGROUND_TOKEN", true), path);
    ditto.StartSync();
}
catch (DittoException ex)
{
    Console.WriteLine($"Ditto Error {ex.Message}");
}
```

