none
How to troubleshoot .net3.5 WinForm localization

    Question

  • If I use .net 4 or 4.5 it works well, but when I use .net3.5 it's not work

    Step to reproduce this problem:

    • create simply winform project Form1.Text = Form1
    • set in Form1.Localizable = true
    • change Form1.Language = English
    • change Form1.Text = EnglishFromText
    • change Form1.Language = Russian
    • change Form1.Text = RussianFromText ...
    • for every from language was generated resource file Form1.en.resx, Form1.ru.resx, ...
    • next i modify Form1 constructor to next:

      Thread.CurrentThread.CurrentUICulture = new System.Globalization.CultureInfo("en");
      InitializeComponent();
    • or next:

      Thread.CurrentThread.CurrentUICulture = new System.Globalization.CultureInfo("ru");
      InitializeComponent();
    • when I set Target Framework as .NET Framework 4 in Visual Studio Project Properties after run app in Form title is "EnglishFromText" (or "RussianFromText")

    • but when I set Target Framework as .NET Framework 3.5 after run app in Form title is "Form1"

    • I don't know why but when use .NET Framework 3.5, files Form1.en.resx, Form1.ru.resx ignored and used values from Form1.resx


    • Edited by endrilian Monday, February 04, 2013 2:48 PM
    Monday, February 04, 2013 11:41 AM

All replies

  • Hi endrilian,

    Unfortunately I cannot reproduce the issue with .NET Framework 3.5 in Windows 7. Are you using .NET Framework 3.5 in a new application or changing target framework from the .NET 4 or 4.5 application?

    Would you like to check :

    Does the value set in the .resx file? Does the .resx file's Build Action set to Embedded Resource? Also check the serialization code in Designer.cs file, does the Text property set directly or some statements like resources.ApplyResources(this, "$this")?

    Best regards,


    Chester Hong
    MSDN Community Support | Feedback to us
    Develop and promote your apps in Windows Store
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Tuesday, February 05, 2013 6:44 AM
  • Hi endrilian,

    Unfortunately I cannot reproduce the issue with .NET Framework 3.5 in Windows 7. Are you using .NET Framework 3.5 in a new application or changing target framework from the .NET 4 or 4.5 application?

    Would you like to check :

    Does the value set in the .resx file? Does the .resx file's Build Action set to Embedded Resource? Also check the serialization code in Designer.cs file, does the Text property set directly or some statements like resources.ApplyResources(this, "$this")?

    - I use Visual Studio Express 2012 on Windows 8 (reproduction this scenario on Windows 7 in VS2010 and VS2012 has same result)

    - when I create project (WinFormApp) with default target framework 4.5 (I can't set framework  when I create project)

    - then i set Form Property Localizable = true

    - change Language from default to another

    - change Form Property Text

    Visual Studio automatically generate resource file for current language and add Text for current language value to it resx files

    Designer using resources.ApplyResources(this, "$this") code for form and it controls (resources.ApplyResources(this.ControlName, "ControlName"))

    - when I use .NET 4 or 4.5 localization work correctly

    - but when I change target framework to 3.5 or less its not work

    when I change target framework from 3.5 to 4 or 4.5 it work correctly again



    • Edited by endrilian Tuesday, February 05, 2013 3:22 PM
    Tuesday, February 05, 2013 1:49 PM
  • Hi endrilian,

    I follow the same steps but cannot reproduce the issue.

    Have you tried to test on other machines? Have you also checked the .resx file and designer.cs file I have mentioned?

    Best regards


    Chester Hong
    MSDN Community Support | Feedback to us
    Develop and promote your apps in Windows Store
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Monday, February 11, 2013 1:59 AM