# Installing with NuGet in Visual Studio

To install the Telerik UI for .NET MAUI components, you can use NuGet packages from the public <a href="https://www.nuget.org/packages/Telerik.UI.for.Maui" target="_blank">nuget.org</a> registry (recommended) or from the authenticated Telerik NuGet server.

## Installing from NuGet.org (Recommended)

The `Telerik.UI.for.Maui` package is available on the default `nuget.org` package source in Visual Studio. No additional configuration or authentication is required:

1. Open or create a .NET MAUI project in Visual Studio.
2. Right-click the solution in the **Solution Explorer** and select **Manage NuGet Packages for Solution...**.
3. Make sure the **Package source** is set to `nuget.org`.
4. Click the **Browse** tab, search for `Telerik.UI.for.Maui`, and select it.
5. Choose the target project, select the desired version, and click **Install**.

## Installing from the Telerik NuGet Server

The Telerik NuGet server is a private authenticated feed that you can use as an alternative to nuget.org. This online source lets you download and install various versions of the .NET MAUI controls and enables quick updates with minimal manual intervention.

Before adding the Telerik NuGet server to Visual Studio, make sure you have:

1. .NET MAUI installed on the machine. For more information on the required steps and system requirements, refer to the <a href="https://docs.microsoft.com/en-us/dotnet/maui/get-started/installation" target="_blank">Microsoft .NET MAUI installation guide</a>.
2. A commercial or trial license for Telerik .NET MAUI. Note that the Telerik NuGet server requires authentication and checks if you have a valid license.

### Step 1: Generate an API Key

As the Telerik NuGet server requires authentication, the first step is to obtain an API key that you will use instead of a password. Using an API key instead of a password is a more secure approach, especially when working with [.NET CLI](https://www.telerik.com/maui-ui/documentation/installation/manual-installation-approaches/nuget/using-dotnet-cli) or the [`NuGet.Config` file](https://www.telerik.com/maui-ui/documentation/installation/manual-installation-approaches/nuget/nuget-config).

1. Go to the [API Keys](https://www.telerik.com/account/downloads/api-keys) page in your Telerik account.

2. Click **Generate New Key +**.

   ![Manage API Keys](https://www.telerik.com/maui-ui/documentation/assets/14757e5faedad989622f3dfe14797297/account-generate-api-key.png)

3. In the **Key Note** field, add a note that describes the API key.

4. Click **Generate Key**.

5. Select **Copy and Close**. Once you close the window, you can no longer copy the generated key. For security reasons, the **API Keys** page displays only a portion of the key.

6. Store the generated NuGet API key as you will need it in the next steps. Whenever you need to authenticate your system with the Telerik NuGet server, use `api-key` as the username and your generated API key as the password.

> API keys expire after two years. Telerik will send you an email when a key is about to expire, but we recommend that you set your own calendar reminder with information about where you used that key: file paths, project links, AzDO and GitHub Action variable names, and so on.

### Step 2: Add the Telerik NuGet Package Source to Visual Studio

To configure the Telerik NuGet feed in Visual Studio:

1. Open Visual Studio.
2. Go to **Tools > NuGet Package Manager > Package Manager Settings**.
3. Select **Package Sources**, and then click the + button.
4. In the **Source** field, enter `https://nuget.telerik.com/v3/index.json`. If you use a locally available NuGet package downloaded from <a href="https://www.telerik.com/account/" target="_blank">your Telerik account</a>, add the path to the local package instead of the URL.
5. Click **Update** and then **OK**.

![Package Sources field with the checked Telerik NuGet option](https://www.telerik.com/maui-ui/documentation/assets/538533b7878573fb90b095eb31079b68/nuget-vs-telerik-server.png)

You have successfully added the Telerik NuGet feed as a Package source.

### Reset Store Credentials

If you previously stored credentials for the Telerik NuGet server, you need to reset them to be able to authenticate with your new API key. Here are the steps you need to follow:

1. Remove the saved credentials in the [Windows Credential Manager](https://support.microsoft.com/en-us/windows/accessing-credential-manager-1b5c916a-6a16-889f-8581-fc16e8165ac0). These credentials will appear as `nuget.telerik.com` or `VSCredentials_nuget.telerik.com` entries.
2. Remove the Telerik NuGet package source from Visual Studio.
3. If you have added the Telerik package source by using the .NET CLI, try to remove it by running the following commands:
   * [`dotnet nuget list source`](https://docs.microsoft.com/en-us/dotnet/core/tools/dotnet-nuget-list-source)
   * [`dotnet nuget remove source`](https://docs.microsoft.com/en-us/dotnet/core/tools/dotnet-nuget-remove-source)
4. Check if you have any credentials stored in `%AppData%\NuGet\Nuget.Config`. If so, remove them.
5. Try to reset the Visual Studio user data by [forcing NuGet to ask for authentication](https://stackoverflow.com/questions/43550797/how-to-force-nuget-to-ask-for-authentication-when-connecting-to-a-private-feed).
6. Restart Visual Studio.
7. Add the Telerik NuGet package source again through Visual Studio or .NET CLI. If you are using the Telerik NuGet feed in a .NET Core application, use a [NuGet API key in the NuGet.Config file](https://www.telerik.com/maui-ui/documentation/installation/manual-installation-approaches/nuget/nuget-config).

### Step 3: Install the Telerik UI for .NET MAUI NuGet Package

The next steps describe how to authenticate your local NuGet instance and display the available packages:

1. Create a new .NET MAUI project or open an existing project.

2. Right-click the solution in the **Solution Explorer** window.

3. Select **Manage NuGet Packages for Solution...**.

4. Select the Telerik NuGet **Package source** from the drop-down list.

5. Click the **Browse** tab to see the available packages.

6. In the authentication window, enter `api-key` in the **User name** field and the [generated API key](https://www.telerik.com/maui-ui/documentation/installation/manual-installation-approaches/nuget/visual-studio#step-1-generate-an-api-key) in the **Password** field.

   ![Windows authentication window in VS](https://www.telerik.com/maui-ui/documentation/assets/a5702d4e64cd251be35b725ab50d2819/vs-nuget-auth-window.png)

7. In the Visual Studio Package Manager, you will see all packages that are licensed to your user account.

8. Search for the `Telerik.UI.for.Maui` package and select it.

9. Choose the projects which require the package.

10. Select the desired version and click **Install**.

    ![Manage Packages for Solutions dialog with the search field and the Telerik.UI.for.MAUI package](https://www.telerik.com/maui-ui/documentation/assets/4f0ccde861421f197002608bafe1db27/maui-nuget.png)

### Step 4: Register the Required Handlers

To visualize the [Telerik UI for .NET MAUI](https://www.telerik.com/maui-ui) controls, you have to register the required handlers by calling the `Telerik.Maui.Controls.Compatibility.UseTelerik` extension method inside the `Configure` method of the `MauiProgram.cs` file of your project.

1. Add the needed `using` settings inside the `MauiProgram.cs` file.

```C#
using Telerik.Maui.Controls.Compatibility;
```

1. Call the `UseTelerik()` method inside the `MauiProgram.cs` file.

```C#
public static class MauiProgram
{
   public static MauiApp CreateMauiApp()
   {
   	var builder = MauiApp.CreateBuilder();
   	builder
   		.UseTelerik()
   		.UseMauiApp<App>()
   		.ConfigureFonts(fonts =>
   		{
   			fonts.AddFont("OpenSans-Regular.ttf", "OpenSansRegular");
   		});

   	return builder.Build();
   }
}
```

## See Also

* [Troubleshooting Common NuGet Setup Issues](https://www.telerik.com/maui-ui/documentation/installation/manual-installation-approaches/nuget/nuget-troubleshooting)
* [Productivity Extensions for Visual Studio](https://www.telerik.com/maui-ui/documentation/installation/vs-integration/overview)
* [Telerik Toolbox for .NET MAUI on Windows](https://www.telerik.com/maui-ui/documentation/installation/vs-integration/toolbox)
