Search code examples
c#processglobalizationcultureinfo

How to start a new unmanaged Process with different culture?


I need to run a new Process from .NET application with a culture of my choice. This process will run an external unmanaged 3rd party exe. How can I make it run with a specific culture?

Note that I don't want to change culture for thread which can be done like this:

System.Treading.Thread.CurrentThread.CurrentCulture = new CultureInfo("fr-FR")

I dont want to setup a default culture for new threads which can be done by reflection or:

CultureInfo.DefaultThreadCurrentUICulture = new CultureInfo("fr-FR")

Solution

  • If executable is .Net application you can create your own proxy executable, set culture the way you want and "start" the other application by loading its executable via reflection and launching corresponding Main method. You'll likely need to understand configuration and assembly loading APIs to get all working correctly if it does not magically start on a first try.

    For native apps I'm afraid you'd need to change regional settings or for some applications their own configuration.