As soon as I added a resource to my project, all code references containing "Properties.Resources" were marked as an error, telling me that "The type or namespace name 'Resources' does not exist in the namespace 'MyProject.Properties' (CS0234).
The only thing I did was navigating to the properties of my project and then adding a resource in the resource tab by clicking "Add resource" and then selecting an exisitng PNG file. When the resource file was added, the errors suddenly appeared.
Normally, these errors didn't occur as I already added a lot of other resources to my project. Why do these errors suddenly appear?
It's a WinForms application and the target Framework is .NET Framework 4.6.1.
I solved the problem on my own.
Some time ago I changed the name of my project's default namespace by only renaming it.
However, I didn't change the references in various files, e.g. in the Resources.resx
file. As a result, the namespace Properties
could not be found.
I solved the problem by renaming the namespace to its default name.
EDIT: As I read here, the default namespace in the project properties also needs to be changed in order to change the references in all other files too.