0
我有一個wpf應用程序和應用程序依賴的庫的解決方案。應用程序調用該庫的方法(帶有組件名稱序列化),其反過來與加載代碼的圖像從調試版本更改爲發佈版本時'找不到資源'異常
const string adornerImageUri = "pack://application:,,,/Serialization;component/TimelinePanel/Images/BoundaryAdornerGlyph.gif";
adornerImage.UriSource = new Uri(adornerImageUri, UriKind.Absolute);
BoundaryAdornerGlyph.gif的生成操作設置爲「資源」和複製到輸出目錄被設置爲「待辦事項不復制「。上面的代碼在解決方案中給出了「無法找到資源」異常,因此應用程序和庫是在釋放模式下構建的,而在調試模式下構建時沒有異常。我正在使用Visual Studio 2010.爲什麼會發生這種情況?