Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/.net/22.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/ionic-framework/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
.net System.Windows.Media.DrawingVisual.RenderOpen()在一段时间后出错_.net_Wpf_Iis_Rendering_System.windows.media - Fatal编程技术网

.net System.Windows.Media.DrawingVisual.RenderOpen()在一段时间后出错

.net System.Windows.Media.DrawingVisual.RenderOpen()在一段时间后出错,.net,wpf,iis,rendering,system.windows.media,.net,Wpf,Iis,Rendering,System.windows.media,用例:我正在使用WPF在web上下文中动态地将文本覆盖到图像上 解决方案: 我正在使用DrawingVisual中的DrawingContext(使用语句包装在中)来绘制原始位图和覆盖文本 问题:在数千个请求之后,[DrawingVisual].RenderOpen()方法开始拒绝执行并引发以下异常: The system cannot find the file specified System.ComponentModel.Win32Exception UInt16 RegisterClas

用例:我正在使用WPF在web上下文中动态地将文本覆盖到图像上

解决方案: 我正在使用
DrawingVisual
中的
DrawingContext
(使用
语句包装在
中)来绘制原始位图和覆盖文本

问题:在数千个请求之后,
[DrawingVisual].RenderOpen()
方法开始拒绝执行并引发以下异常:

The system cannot find the file specified System.ComponentModel.Win32Exception UInt16 RegisterClassEx(WNDCLASSEX_D) at MS.Win32.UnsafeNativeMethods.RegisterClassEx(WNDCLASSEX_D wc_d)
at MS.Win32.HwndWrapper..ctor(Int32 classStyle, Int32 style, Int32 exStyle, Int32 x, Int32 y, Int32 width, Int32 height, String name, IntPtr parent, HwndWrapperHook[] hooks)
at System.Windows.Media.MediaContextNotificationWindow..ctor(MediaContext ownerMediaContext)
at System.Windows.Media.MediaContext..ctor(Dispatcher dispatcher)
at System.Windows.Media.MediaContext.From(Dispatcher dispatcher)
at System.Windows.Media.Visual.VerifyAPIReadWrite()
at System.Windows.Media.DrawingVisual.RenderOpen()
at ...
临时修复:唯一的修复方法是在服务器上回收IIS应用程序池,这将在几个小时内修复问题


问题:有人对这个问题的原因(泄漏、线程、非托管代码等)有想法吗?有没有其他方法可以在图像上获取文本,从而避免图形的可视性?可能是将几何体写入位图并直接覆盖位图?

这是一个旧补丁-我本以为它包含在.NET 4.x中-但我不太确定。无论如何,你可以试一试

»


»

我遇到了一个类似的问题:您能否分享一段代码片段,说明如何获取DrawingContext和DrawingVisual?为什么不直接回收DrawingVisual?您是否允许调度程序启动?我知道这是一个老问题,但是进程是否会泄漏内存或处理?看来一个挂起的垃圾堆可能有助于找到问题的根源?