How to fix the 'Resources' is not a member of 'My'

In VS2010 Look in the Solution Explorer at [Your Project] -> My Project -> Resources.resx. Click on "Properties" and make sure that "Custom Tool Namespace" says "My.Resources". (took me an hour to figure this out)


The above is a valid solution but I noticed in my case that the error resulted from another issue. Sometimes what we think is the error is actually the result of a preceding error. You can get this error as well if you deleted the resources from the Resource folder in the Solution Explorer. If you intended on removing these resources then you need to actually delete them by clicking the "Remove Resource" button in the Resources section of your project properties. This will then remove traces of the missing item in the underlying auto-generated code. After clearing an icon resource file that was deleted improperly I no longer had an issue with VS losing reference to My.Resources.

Hope that helps someone.

Update: I also received this error when I added a resource file to my project when it was open in another program. In my case I added a User Manual word document but it was still open in Word. All I had to do to remedy this issue was delete the word document out of my resources, close it in Word and re-add it again. Once I built the solution the errors went away.

Tags:

.Net

Vb.Net