Problem with Globalization on VS 2017

Hi.
I trying to do the multi language application on Windows 10, Visual Studio 2017. The working code I used before stop to work for some reason.
using System;
using System.Windows.Forms;
using System.Resources;
using System.Globalization;


namespace Language
{
    public partial class Form1 : Form
    {
        ResourceManager res_man;    // declare Resource manager to access to specific cultureinfo
        CultureInfo cul;            //declare culture info
        string test_string;
        public Form1()
        {
            InitializeComponent();
        }

        private void Form1_Load(object sender, EventArgs e)
        {
            res_man = new ResourceManager("Language.Resource.Res", typeof(Form1).Assembly);
            switch_language();
        }

        private void switch_language()
        {
             cul = CultureInfo.CreateSpecificCulture("eng");        //create culture for English
             test_string = res_man.GetString("Test", cul);
            label1.Text = test_string;

        }
    }
}
I downloaded project from www.codeproject.com and it gives the same error:
System.Resources.MissingManifestResourceException: 'Could not find any resources appropriate for the specified culture or the neutral culture.  Make sure "Language.Resource.Res.resources" was correctly embedded or linked into assembly "Language" at compile time, or that all the satellite assemblies required are loadable and fully signed.'

What I do wrong?
LVL 1
mastiSoftAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Robberbaron (robr)Commented:
not sure of the real reason but looking at https://msdn.microsoft.com/en-us/library/system.globalization.cultureinfo.createspecificculture(v=vs.110).aspx   "eng" does not appear to be a recognised name.


should it be "en-US"  or "en-UK"

see snippet4 for MS way of changing culture.
https://msdn.microsoft.com/en-us/library/system.globalization.cultureinfo(v=vs.110).aspx?cs-save-lang=1&cs-lang=csharp#code-snippet-4
1
mastiSoftAuthor Commented:
Hi.
I found the problem and now it's working. By changing properties of the language resource file "Copy to Output Directory" to: COPY ALWAYS.
I don't use the globalization now but :
using System.Resources;
3. Add declaration
namespace tcp_fftw
{
    public partial class Form1 : Form
    {
     //path to the language file:
        static string resxFile;
        ResXResourceSet resxGet;
        string CaptionFile;

4. Add to source code:

 // last selected language file
            string lng = Properties.Settings.Default.Language;
            if (lng=="eng")//english
            {
                resxFile = @".\eng.resx";
            }
            if (lng=="rus")//Russian
            {
                resxFile = @".\rus.resx";
            }

            resxGet = new ResXResourceSet(resxFile);

             
            CaptionFile = resxGet.GetString("Notconnected"); //here select the infor on the language file
            tlStatus.Text = CaptionFile;// "Not connected";// show text
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
mastiSoftAuthor Commented:
the suggestions I received didn't help but I found my own solution .
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
C#

From novice to tech pro — start learning today.