Laurent
Laurent

Reputation: 6205

How to change MSBuild error message language?

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?

Upvotes: 25

Views: 14606

Answers (9)

Alexander Petroff
Alexander Petroff

Reputation: 11

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

Upvotes: 1

Jaroslav Kubacek
Jaroslav Kubacek

Reputation: 1447

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

Upvotes: 8

Andrea Giudiceandrea
Andrea Giudiceandrea

Reputation: 255

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\

Upvotes: 7

user3302274
user3302274

Reputation: 292

environment variable for eng: set VSLANG=1033

Upvotes: 20

Ntrf
Ntrf

Reputation: 73

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.

Upvotes: 3

Andrey
Andrey

Reputation: 965

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

Upvotes: 16

Petr Silar
Petr Silar

Reputation: 157

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.

Upvotes: 14

knut
knut

Reputation: 4745

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.

Upvotes: 3

Preet Sangha
Preet Sangha

Reputation: 65476

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.

Upvotes: 0

Related Questions