Caso de uso: Estoy usando WPF para superponer dinámicamente texto en imágenes dentro de un contexto web.System.Windows.Media.DrawingVisual.RenderOpen() error después de un tiempo
Solución: estoy usando un DrawingContext
de un DrawingVisual
(envuelto en un comunicado using
) para dibujar el mapa de bits original y superponer texto.
Problema: Después de unos pocos miles pide al método [DrawingVisual].RenderOpen()
comienza a negarse a ejecutar y desencadena la siguiente excepción:
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 ...
solución Temp: La única solución para este es reciclar el grupo de aplicaciones de IIS en el servidor de la cual arregla el problema por unas horas.
Pregunta: Alguien tiene una idea sobre la causa de este problema (fugas, subprocesos, código no administrado, etc.)? ¿Hay alguna otra manera de obtener texto en una imagen evitando el dibujo visual? ¿Quizás escribir geometría en un mapa de bits y superponer los mapas de bits directamente?
estoy teniendo un problema similar: http://stackoverflow.com/questions/5195808/wpf-formattedtext-the-system-cannot-find-the-file -specified-exception-in-a-serv – Aligned
¿Puede compartir un fragmento de código de cómo obtiene el DrawingContext y el DrawingVisual? ¿Por qué no reciclar el DrawingVisual? ¿Estás permitiendo que el Dispatcher bombee? –
Sé que esta es una vieja pregunta, ¿pero el proceso pierde memoria o maneja? ¿Parece que un tugurio podría ayudar a llegar a la raíz del problema? –