I have a solution with a wpf application and a library which the application depends on. Application invokes a method on the library(with assembly name Serialization) which in turn loads an image with code
const string adornerImageUri = "pack://application:,,,/Serialization;component/TimelinePanel/Images/BoundaryAdornerGlyph.gif";
adornerImage.UriSource = new Uri(adornerImageUri, UriKind.Absolute);
Build action of BoundaryAdornerGlyph.gif is set to 'Resource' and Copy to Output Directory is set to 'Do not Copy'. Above code gives 'cannot locate resource' exception when solution, as a result application and the library, is built in release mode whereas there is no exception when built in debug mode. I am using Visual Studio 2010. Why this happens?