For some reason on my current project I create my resource file via the project properties, add a load of existing images. Then go to add these images to menu items, save it. At this point everything looks fine and the images are all mapped correctly.
However once I close the designer for that form, then open it up I get the error dialog saying:
The type 'My.Project.Properties.Resources' has no property named 'icon_plus'.
The annoying thing is that if you follow it through to the code there is no error, it compiles fine:
this.newToolStripMenuItem.Image = global::My.Project.Properties.Resources.icon_plus;
I have tried deleting all resources and removing the resource file from the project, completely closing down the IDE then re-loading it. I have moved the location of the files, but I am just out of ideas and it is REALLY starting to grate with about 10 forms and controls which each give me this error them remove the icons from the UI.
Take a look at project references, and remove the reference to self.
This is one of those VERY annoying issues, which I would never have thought about until I got another issue which caused me to change things.
It seems to have been down to the application using the Client Profile for .net 4 rather than just the default .net 4 runtimes. Once I changed this over this issue stopped and my other missing namespace issue which recently arose went away.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With