Could not find the resource

Sergio23 271 Reputation points

Hello to all
I have a problem with a sample C # resource program.

Program link:

I follow all the instructions, I do all the builds, but when I run the program, it crashes with the following error:
System.Resources.MissingManifestResourceException: 'Could not find the resource "ExampleResources.resources" among the resources "" embedded in the assembly "Example", nor among the resources in any satellite assemblies for the specified culture. Perhaps the resources

Where is the problem?

An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
10,461 questions
0 comments No comments
{count} votes

1 additional answer

Sort by: Most helpful
  1. Timon Yang-MSFT 9,576 Reputation points

    I reproduced your problem but haven't found a solution yet.

    But there is another way to add resources, right click on the project=> Add=> New Item=>Resources File.


    Then slightly modify the code in the document:

                string[] cultures = {  "en-us", "fr-FR" };  
                Random rnd = new Random();  
                int index = rnd.Next(0, cultures.Length);  
                Thread.CurrentThread.CurrentUICulture = CultureInfo.CreateSpecificCulture(cultures[index]);  
                Console.WriteLine("The current culture is {0}",  
                string grtting = ExampleResources.Greeting;  
                Console.Write("Enter your name: ");  
                string name = Console.ReadLine();  
                Console.WriteLine("{0} {1}!", grtting, name);  

    If the response is helpful, please click "Accept Answer" and upvote it.
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.