20
votes

I'm on a Japanese system and when I run MsBuild.exe to build a Visual Studio project, I get a mix of Japanese and English in the output:

C:\path\to\solution>C:\WINDOWS\Microsoft.NET\Framework\v3.5\msbuild.exe solution.sln
Microsoft (R) Build Engine Version 3.5.30729.1
[Microsoft .NET Framework, Version 2.0.50727.3082]
Copyright (C) Microsoft Corporation 2007. All rights reserved.

Build started 2/18/2010 1:03:04 PM.
Project "C:\path\to\solution.sln" on node 0 (default targets).
  Building solution configuration "Debug|Win32".
プロジェクト : warning PRJ0018: 以下の環境変数が見つかりませんでした:

How can I change it all back to English?

9
I created this ticket at Visual Studio bug tracker so that we can choose MSBuild localization easier : developercommunity.visualstudio.com/content/problem/1271546/… Please upvote it if you want he situation to improve. - Kiruahxh

9 Answers

14
votes

environment variable for eng: set VSLANG=1033

13
votes

Just solved the same problem with Russian:

I have removed following directories:

  • c:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\MSBuild\15.0\Bin\amd64\ru
  • c:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\MSBuild\15.0\Bin\amd64\ru-RU
11
votes

To change the language of MSBuild's output to English, simply call chcp 850 in the same console before actual call of MSBuild. It changes console's code page and MSBuild uses it.

7
votes

I was facing similar problem on machine WIN 8.1. It was installed in Czech and later English language pack was added. Result was that MsBuild started from console was in Czech language. I found in Region setting option Change system locale.. was in Czech. After switching to English output was in English.

Region language settings

Update for Windows 10

Region Windows 10

6
votes

You need to remove the localization sub dirs (e.g. for italian: "1040", "it", "it_IT") from the following directories:

c:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\MSBuild\15.0\Bin\

c:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\MSBuild\15.0\Bin\amd64\

3
votes

NOTE: After studying laurent's output a little more I do agree with Preet Sangha's answer. The output may come from the compiler not MSBuild. But if it was MSBuild that produced messages in wrong language, like in my case, I think my answer will work for you. So my answer really answers the title of this question.


I think your messages are coming from a Japanese Microsoft.Build.Tasks.resources.dll resource file. The Microsoft.Build.Tasks assembly contains build related tasks that are executed by MSBuild. These tasks output build related messages.

I think you have one or more Japanese .NET framework language packs. The solution is to uninstall all Japanese .NET framework language packs in Windows add remove programs dialog.


I had Norwegian MSBuild output. When I removed my Norwegian language pack I got standard English error messages. My Norwegian resource files where located in:

  • C:\Windows\Microsoft.NET\Framework\v4.0.30319\no
  • C:\Windows\Microsoft.NET\Framework\v4.0.30319\MOF\no
  • C:\Windows\Microsoft.NET\Framework\v4.0.30319\SQL\no
  • C:\Windows\Microsoft.NET\Framework\v4.0.30319\WPF\no
  • C:\Windows\Microsoft.NET\Framework64\v4.0.30319\no
  • C:\Windows\Microsoft.NET\Framework64\v4.0.30319\MOF\no
  • C:\Windows\Microsoft.NET\Framework64\v4.0.30319\SQL\no
  • C:\Windows\Microsoft.NET\Framework64\v4.0.30319\WPF\no

These folders where removed after I uninstalled the Norwegian .NET framework language packs.


I think it is easier to search for information when you have standard English warning and error messages, so I would allways want to remove local language packs for developer tools.

3
votes

I had a problem with logfiles being encoded with UTF-8 multiple times on a buildserver. This makes solutions like changing system language or deleting all the localizations for all the software undesirable. So i had to find an option to set system language in console.

Most of the time, you should be happy with using chcp 437 command at the begining of your .cmd file. This will switch to the official "hardware" codepage 437, which is included as part of your PC BIOS. It does, however, include characters for european languages, even if Microsoft calls it "OEM United States".

To exclude all the languages, except for readable english, you should use codepage 20127, which contains ASCII-only charachers. All "extended" characters will be rendered as ? (question marks). This is an extreme solution and only use it when nothing else works, as it will ruin your output if it happens to have any extended characters. I'm not sure it's a good idea, 'cause it's not and OEM charset, but it worked for me.

1
votes

You need to remove language pack Jp and add English pack in Visual Studio Installer.

0
votes

I suspect that message is coming from the compiler to your project, not the msbuild itself. But I don't know how to change it.