1
The problem is in a project I’m doing added 2 resources Main.resx I want to get data inside this Resource this way:
System.Resources.ResourceManager rm = new ResourceManager(typeof(System.Resources_example.Main));
I have the Main.resx feature in my project but I can’t access it System.Resources_example.Main in this part of the code that error occurs Visual Studio does not recognize the Main.resx feature
What is
System.Resources_example
? You created a resrouce with namespaceSystem
? thattypeof()
refers to the class generated by.resx
. Normally this class does not reside in theSystem
namespace– brazilianldsjaguar
@Alan Maik, I was having a similar problem, see if it helps you: https://answall.com/questions/199035/problema-ao-pega-key-de-arquivo-resx
– Artur Trapp
@Artyou need a good example of how to use Resource:
Resources.Main
. Class is based on file name.– brazilianldsjaguar
The name of My class is System.Resources_example the name of my Source is Main.resx I need to access it to consume the resources
– Alan Maik
It’s not just accessing directly:
System.Resources_example.Main.???
the name of the resource?– novic
Then I cannot access the resource when I put System.Resources_example. appears to me only the Program option does not appear my Resource
– Alan Maik
Open the Resource design and check the namespace if it is the same! or thing you left it with
public
?– novic
Resolved by changing the namespace on Main.Designer.Cs was with the name of another project thank you !
– Alan Maik