Run C# Application in Different Language using Visual Studio

1.6k Views Asked by At

I have an application which has several resource files for different languages depending on the machines culture/language. This works fine if i set the Culture using code, but I am wanting to specify the culture on the command line somehow.

I know in java you simply need to set the VM Args lang attributes and the application starts up in that language, but I am unsure if this is possible using Visual Studio as it doesnt have this type of option.

Can anyone provide a non code solution, I know i could set some cmd line args to read in the lang and then set it using a bit of code but I am wanting to know if there is another way.

I also dont want to keep switching my language using my machine setting.

2

There are 2 best solutions below

0
On BEST ANSWER

Cultures are a .NET specific thing, picked up at run-time from the current users 'Locale'. This can be changed by a user at runtime, on a per-application basis.

The default 'Execute Process' functionality does not really support this, a Microsoft utility exists "AppLoc" which adds this functionality. There is an article available on CodeProject Running AppLoc from Batch Files explains how to better control this.

1
On

Why do you need to set this using cmd line args? You could just use current thread CurrentUICulture property to get it.