about WPF GetResourceStream
StreamResourceInfo streamInfo = Application.GetResourceStream(new uri("UIOnly;component/Images/my_work.png", UriKind.Relative));
if ((streamInfo != null) && (streamInfo.Stream != null))
{
开发者_JAVA百科 using (var stream = streamInfo.Stream)
{
}
}
when above code executed, the UIOnly.dll is locked until application exit, why??
Somehow the file handle is not released.
Have you tried explicit calling Close on the stream instead of just disposing it?
精彩评论