I am using VS2010 and in all of my projects \"My.Resources\" is available and shows all the files that are in the \"resources\" section of the project. In this one project I
I face this problem all the time and this solution works for me all the time.
Click on Show All Files in solution explorer.
Navigate to file named "Resources.resx" under "My Project" folder.
In properties for that file rename the file's [Custom Tool Namespace] to anything other than "My.Resources". (I name it to "My.Resource").
Clean and Rebuild the solution.
Navigate back to "Resources.resx" in properties. Rename the file's [Custom Tool Namespace] back to "My.Resources".
Clean and build the solution again.
Your problem should be fixed.
Private lockedImage = My.Resources.Resource.myfile
Hope it works...
According to Denis solution: I am adding little more details with his answer.
Step 1 Click on Show All Files button.
Step 2 Click on expand button left to My Project.
Step 3 Right click on Resources.resx.
Step 4 Click on Properties.
Step 5 - Change the name My.Resources to anything example My.ResourcesRepair then save changes and again name it back to My.Resources and save changes and then rebuild.
Fütemire described my problem. I had just "cleaned up" some unused files in both the resources (doing an Open My Project within VS) and probably (I must admit), I deleted some files directly from the Resources folder outside of VS. Oops.
I just opened Resources.resx file and found two items that red underscores, indicating it couldn't find these files. I removed those data blocks within the XML file and that fixed the problem for me. Thanks.
simply edit the Resources.resx
in notepad++. Trace the cause of the error (error displays in the Resources tab of your project properties), remove the line that causes the error. then on your solution explorer, right-click Resources.resx
then Run Custom Tool
.
this would surely resolve the problem.
In My case the simple fix was
resources.resx
file to not have duplicate entries as mentioned above.Windows Forms Application
to Class Library
, then change it back.My.Resources
again.