hmcclungiii
hmcclungiii

Reputation: 1805

The language name 'en-US' is invalid. (CS2038)

In an empty solution, I keep getting the warning - The language name 'en-US' is invalid. (CS2038). I've tried everything. But when I switch to C# 3.0, .NET 3.5 the warning goes away. The warning goes away when I create a VB.NET Windows application solution as well. Only when I create a c#5.0 NET 4.5 Windows Application Solution does this occur. And I have to have 4.5 because of dependent libraries compiled against 4.5.

Has anyone else seen this? It seems to be independent of #Develop. Is there a config file or something for the .NET 4.5 framework C# that I'm missing?

Edited to add for clarification (from comments):

I've reduced it to no source code files at all. Strangely enough it does not do this on my Windows 7 machine, only on my Vista. Windows 7 being 64 bit and the Vista machine being 32. I'm sure it has something to do with that.

Upvotes: 3

Views: 724

Answers (1)

Tom Pažourek
Tom Pažourek

Reputation: 10167

For me, the issue was that the culture en-US was registered as a "custom culture" in Windows.

In PowerShell running as Administrator, you can execute the following to unregister the custom culture:

Add-Type -AssemblyName sysglobl;
[System.Globalization.CultureAndRegionInfoBuilder]::Unregister("en-US");

In the Windows Control Panel "Region" window, you can check the * that indicates custom culture. This is how it's supposed to look afterwards (see there's no longer any * in the English (United States) name):

enter image description here

Upvotes: 1

Related Questions