first_page

Problems with WPF Image Resources

The acronym CTP comes to haunt me for Windows Presentation Foundation. Apparently, resource files used in XAML Image elements with Source="Resources\MyPic.png" become corrupt. When you click on the alleged corrupt file you should see an error like:

Attempted to read of write protected memory. This is often an indication that other memory is corrupt.

Researching this error message suggests that my recent installation of Team Explorer might have something to do with this. My ineffective responses to this problem have been:

  • Remove the default Resource files and rebuild them
  • Start a fresh WPF Project and add Resource files
  • Reapply (repair) the WPF November CTPOne theory to avoid this problem involved using Expression Blend to generate a Resource Dictionary but apparently this is overkill. What seems to be working is using Expression Blend to add an image file as an “existing item.” Double-clicking on the image adds it to the design surface. Repeating this procedure my Visual Studio will throw the aforementioned “memory is corrupt” error.

rasx()