---
title: "Troubleshooting applications created with the ASP.NET Rendering SDK"
slug: "troubleshooting-applications-created-with-the-asp-net-rendering-sdk"
abstract: "Investigate and resolve issues in your ASP.NET rendering hosts."
---
# Troubleshooting applications created with the ASP.NET Rendering SDK

> [!important]
> If you integrated your ASP.NET Core app before September 2024, it's using the legacy ASP.NET Core Rendering SDK, version 22 or earlier. This SDK is no longer receiving updates, so we recommend that you [upgrade to the latest version of the new ASP.NET Core SDK](https://doc.sitecore.com/xmc/en/developers/asp-net/latest/asp-net-core-sdk/upgrade-from-v22.html).

This topic describes issues you might encounter in applications created with the ASP.NET Rendering SDK and explains possible solutions.

<details>
<summary><h2>Handling validation errors for request headers</h2></summary>

If you are getting errors about request header validation and are using the Layout Service REST API, you can define a list of headers to be skipped during header validation.

To configure headers that skip the validation process:

- In the `Startup.cs` file, provide an array of headers to the `AddHttpHandler` extension method as the `nonValidatedHeaders` parameter. For example:

    ```csharp
    services
         // ...
        .AddHttpHandler("your_handler_name".Name, sp =>
        {
            var factory = sp.GetRequiredService<System.Net.Http.IHttpClientFactory>();
            var client = factory.CreateClient("your_handler_name");

            client.BaseAddress = "your_handler_uri";

            return client;

         }, new [] { "User-Agent" })
        // ...
    ```

Alternatively, define the list of headers in the `appsettings.json` file and provide them as a configuration property:

1. In the `appsettings.json` file, specify a new property with an array of strings as a value. For example:

    ```JSON
    "Sitecore": {
      "HeadersToSkipValidation": ["User-Agent"]
    }
    ```

2. In the `\Configuration\SitecoreOptions.cs` file, specify the new property:

    ```csharp
    public class SitecoreOptions{
     // ...
     public string[] HeadersToSkipValidation { get; set; } = new string[0];
     // ...
    }
    ```

3. Finally, in the `Startup.cs` file, use the `AddHttpHandler` extension method and provide the array of headers as the `nonValidatedHeaders` parameter:

    ```csharp
    services
    // ... other code
       .AddHttpHandler("<your_handler_name>", sp =>
       {
           var factory = sp.GetRequiredService<System.Net.Http.IHttpClientFactory>();
           var client = factory.CreateClient("default");
           client.BaseAddress = Configuration.LayoutServiceUri;
           return client;
      }, Configuration.HeadersToSkipValidation) 
    // ... other code
    ```

</details>