Errore generico GDI+ quando parte l'applicazione.

venerdì 05 novembre 2010 - 19.55
Tag Elenco Tags  C#  |  VB.NET  |  .NET 4.0  |  Visual Studio 2010

erongis Profilo | Junior Member

Ho un problema pazzesco. In Visual studio .NET 2010 (indipendentemente dal linguaggio) quando faccio una forma con dentro o un menu e una toostrip con dei bottoncini dentro, all'avvio mi apparelerrore seguente:
-----------------------------------------
System.Runtime.InteropServices.ExternalException non è stata gestita
Message=Errore generico in GDI+.
Source=System.Drawing
ErrorCode=-2147467259
StackTrace:
in System.Drawing.Graphics.CheckErrorStatus(Int32 status)
in System.Drawing.Graphics.FillRectangle(Brush brush, Int32 x, Int32 y, Int32 width, Int32 height)
in System.Drawing.Graphics.FillRectangle(Brush brush, Rectangle rect)
in System.Windows.Forms.ToolStripProfessionalRenderer.FillWithDoubleGradient(Color beginColor, Color middleColor, Color endColor, Graphics g, Rectangle bounds, Int32 firstGradientWidth, Int32 secondGradientWidth, LinearGradientMode mode, Boolean flipHorizontal)
in System.Windows.Forms.ToolStripProfessionalRenderer.RenderToolStripBackgroundInternal(ToolStripRenderEventArgs e)
in System.Windows.Forms.ToolStripProfessionalRenderer.OnRenderToolStripBackground(ToolStripRenderEventArgs e)
in System.Windows.Forms.ToolStripRenderer.DrawToolStripBackground(ToolStripRenderEventArgs e)
in System.Windows.Forms.ToolStrip.OnPaintBackground(PaintEventArgs e)
in System.Windows.Forms.Control.PaintWithErrorHandling(PaintEventArgs e, Int16 layer)
in System.Windows.Forms.Control.WmPaint(Message& m)
in System.Windows.Forms.Control.WndProc(Message& m)
in System.Windows.Forms.ScrollableControl.WndProc(Message& m)
in System.Windows.Forms.ToolStrip.WndProc(Message& m)
in System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
in System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
in System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
in System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
in System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(IntPtr dwComponentID, Int32 reason, Int32 pvLoopData)
in System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
in System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
in System.Windows.Forms.Application.Run(ApplicationContext context)
in Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.OnRun()
in Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.DoApplicationModel()
in Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.Run(String[] commandLine)
in WindowsApplication1.My.MyApplication.Main(String[] Args) in 17d14f5c-a337-4978-8281-53493378c1071.vb:riga 81
in System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
in System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
in Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
in System.Threading.ThreadHelper.ThreadStart_Context(Object state)
in System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean ignoreSyncCtx)
in System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
in System.Threading.ThreadHelper.ThreadStart()
InnerException:

---------------------------

Con Visual studio 2008 tutto funziona correttamente.
Ho reinstallato il framework 4, reinstallato visual Studio, ma niente. A design time funziona tutto, ma quando faccio F5 per far partire il debug, s'inchioda.
Ho provato anche a disabilitare Firewall e Antivirus.

Se qualcuno ha qualche idea!!!

luigidibiasi Profilo | Guru

Quella inizializzazione la fai nell'evento onLoad del form principale?
Luigi Di Biasi


http://www.dibiasi.it/
http://netsell.dibiasi.it - ecomm software -
http://blogs.dotnethell.it/luigidibiasi/

erongis Profilo | Junior Member

In realtà non faccio nessuna inizializzazione. Disegno una form, ci metto una toolbar e faccio F5. Non ho scritto una riga di codice. Quello è il dettaglio dell'errore che spero possa essere utile.

Ho provato anche a compilare il progetto e a far partire l'eseguibile. Il tutto funziona lla grande. Solo l'interpretato quando va in esecuzione, scatena l'errore.
Partecipa anche tu! Registrati!
Hai bisogno di aiuto ?
Perchè non ti registri subito?

Dopo esserti registrato potrai chiedere
aiuto sul nostro Forum oppure aiutare gli altri

Consulta le Stanze disponibili.

Registrati ora !
Copyright © dotNetHell.it 2002-2025
Running on Windows Server 2008 R2 Standard, SQL Server 2012 & ASP.NET 3.5