Mario
Mario

Reputation: 14800

Cannot access embedded resource with en-US.resx extension

I have a C# .NET 4.5 project with a custom embeded resource file Messages.en-US.resx

And I cannot access it using this

using System.Reflection;
using System.Resources;

MyApp.Properties.Resources.Messages.MyString

If I add a new resource file without .en-US.resx extension then it works....but I need it for translation to different languages

In my other ASP.NET projects works fine, in Winforms not. I need this resource file for translation.

Upvotes: 0

Views: 470

Answers (1)

EZLearner
EZLearner

Reputation: 1834

At least one messages resource file has to be non-culture-specific. That file has to have a matching .designer file.

Upvotes: 1

Related Questions