2011-01-07 41 views
2
StreamResourceInfo streamInfo = Application.GetResourceStream(new uri("UIOnly;component/Images/my_work.png", UriKind.Relative)); 

if ((streamInfo != null) && (streamInfo.Stream != null)) 
{ 
     using (var stream = streamInfo.Stream) 
     { 

     } 
} 

上面的代碼執行時,UIOnly.dll被鎖定,直到應用程序退出爲止?關於WPF GetResourceStream

+0

你能澄清你的意思是DLL被「鎖定」嗎? – 2011-01-07 04:48:58

回答

0

不知何故文件句柄沒有被釋放。

你試過顯式調用流關閉而不是隻處理它?