WPF – Image ‘is not part of the project or its Build Action is not set to Resource’

Try doing a full rebuild, or delete the build files and then build the file. Visual Studio doesn’t always pick up changes to resources, and it can be a pain to get it recompile. Also try using a full URI as that helped me when I had the same problem. Something like pack://application:,,,/MyAssembly;component/bug.png

Error “A namespace does not directly contain members such as fields or methods”

Figures! As soon as I finally break down and ask the question that I find the answer… The app.config file properties section (somehow) listed the Build Action of “Compile” when it should be set to “None”. How in the world did it get changed? I know I didn’t change it. Grrr… Oh well, at least … Read more

What is Content Build Action in Visual Studio?

“Content” means that it is a deployable project item, it signals that the file needs to be copied to the target machine. Something you can see with a simple console mode project. Project + Add New Item, pick the Bitmap File item template. Its Build Action is automatically set to “Content”. Use Project + Properties, … Read more