---
title: "Running .NET 6 project in Docker throws Globalization.CultureNotFoundException"  
description: "Running .NET 6 project in Docker throws Globalization.CultureNotFoundException"  
author: "Utpal Vishwas"  
published: 2023-11-07  
updated: 2023-11-08  
canonical: https://www.mindstick.com/forum/160452/running-dot-net-6-project-in-docker-throws-globalization-culturenotfoundexception  
category: ".net core"  
tags: ["exception handling", ".net core", ".net core 6"]  
reading_time: 2 minutes  

---

# Running .NET 6 project in Docker throws Globalization.CultureNotFoundException

Running .NET 6 [project](https://www.mindstick.com/articles/105927/how-to-excel-at-managing-multiple-projects) in [Docker](https://www.mindstick.com/forum/161003/what-is-docker) throws Globalization.CultureNotFoundException

## Replies

### Reply by Aryan Kumar

The "Globalization Culture Not Found" exception can occur when running a .NET 6 project in a Docker container if the container environment is not set up to support the culture settings required by your application. To resolve this issue, you can explicitly configure the culture settings within your Docker container. Here's how to do it:

**Set the Culture in Your Dockerfile**:

In your Dockerfile, you can set the culture by using the **LANG** environment variable. For example:

```plaintext
FROM mcr.microsoft.com/dotnet/aspnet:6.0 AS base
WORKDIR /app
EXPOSE 80

ENV ASPNETCORE_URLS=http://+:80
ENV LANG=en_US.UTF-8   # Set the culture to en_US.UTF-8

FROM mcr.microsoft.com/dotnet/sdk:6.0 AS build
WORKDIR /src

# Rest of your Dockerfile for building the application
```

In the above example, we've set the culture to **en_US.UTF-8**. Adjust the culture to match the specific culture and language settings required by your application.

**Install Required Locale Packages**:

Depending on the culture settings you need, you may need to install additional locale packages within your Docker image. For example, to support a specific culture, you can install the required locale package. Here's an example for the en_US locale:

```plaintext
RUN apt-get update -y && apt-get install -y locales
RUN locale-gen en_US.UTF-8
```

This step may vary depending on the base image you're using. Be sure to check the documentation for the specific image you are using.

**Build and Run the Docker Image**:

After making these changes, build your Docker image and run it as you normally would. The culture settings should be correctly configured within the container environment.

By setting the correct culture and, if necessary, installing the required locale packages, you should be able to resolve the "Globalization Culture Not Found" exception when running your .NET 6 project in a Docker container.


---

Original Source: https://www.mindstick.com/forum/160452/running-dot-net-6-project-in-docker-throws-globalization-culturenotfoundexception

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
