2009-12-01 5 views
3

Un ASP.NET site Web pose au hasard cette System.Drawing erreur:System.Drawing: GDI + est pas correctement initialisé (GDI + erreur interne)

System.Runtime.InteropServices.ExternalException: System.Drawing. Bitmap..ctor (stream stream) de System.Drawing.ToolboxBitmapAttribute..cctor()

Exception information: 
    Exception type: TypeInitializationException 
    Exception message: The type initializer for 'System.Drawing.ToolboxBitmapAttribute' threw an exception. 

Stack trace: at System.Reflection.CustomAttribute._CreateCaObject(Void* pModule, Void* pCtor, Byte** ppBlob, Byte* pEndBlob, Int32* pcNamedArgs) 
    at System.Reflection.CustomAttribute.CreateCaObject(Module module, RuntimeMethodHandle ctor, IntPtr& blob, IntPtr blobEnd, Int32& namedArgs) 
    at System.Reflection.CustomAttribute.GetCustomAttributes(Module decoratedModule, Int32 decoratedMetadataToken, Int32 pcaCount, RuntimeType attributeFilterType, Boolean mustBeInheritable, IList derivedAttributes) 
    at System.Reflection.CustomAttribute.GetCustomAttributes(RuntimeType type, RuntimeType caType, Boolean inherit) 
    at System.RuntimeType.GetCustomAttributes(Type attributeType, Boolean inherit) 
    at System.ComponentModel.ReflectTypeDescriptionProvider.ReflectGetAttributes(Type type) 
    at System.ComponentModel.ReflectTypeDescriptionProvider.ReflectedTypeData.GetAttributes() 
    at System.ComponentModel.TypeDescriptor.TypeDescriptionNode.DefaultTypeDescriptor.System.ComponentModel.ICustomTypeDescriptor.GetAttributes() 
    at System.ComponentModel.TypeDescriptor.GetAttributes(Type componentType) 
    at System.Web.UI.ThemeableAttribute.IsTypeThemeable(Type type) 
    at System.Web.UI.Control.ApplySkin(Page page) 
    at System.Web.UI.Control.InitRecursive(Control namingContainer) 
    at System.Web.UI.Control.InitRecursive(Control namingContainer) 
    at System.Web.UI.Control.InitRecursive(Control namingContainer) 
    at System.Web.UI.Control.InitRecursive(Control namingContainer) 
    at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) 

Pourquoi? Je pense qu'il s'agit d'une erreur .NET Framework (je n'essaie en fait de créer aucune image).

je trouve une solution temporaire : redémarrer IIS et supprimer Temporary ASP.NET Files ("% windir% \ Microsoft.NET \ Framework \ v2.0.50727 \ Temporary ASP.NET Files"). Mais quand cette erreur survient sur le serveur web de production, le temporaire ne suffit pas ...

+0

Une chose qui rend les choses plus difficiles est la localisation des messages d'erreur dans IIS. Googling "GDI +: un ei ole alustettu oikein (sisäinen GDI + -virhe)." N'est pas très utile. : -/ –

Répondre

7

Par coïncidence, nous l'avons eu sur un de nos serveurs aujourd'hui. C'est un problème connu dans ASP.NET, il existe un correctif pour cela au http://support.microsoft.com/kb/975410.

+0

Salut! Merci pour la réponse. Je n'ai pas vu cette erreur récemment, alors j'accepte cette réponse. –

1

La modification de ce paramètre pour vrai dans le web.config fixe pour moi:

<validation validateIntegratedModeConfiguration="true" />