win8 x64 下安装了vs2012 补丁到update 3,一直正常使用,昨天觉得系统有点慢,就还原了下原来的做得ghost备份。vs2012变成了update 1。
悲剧发生了,所有的winform源代码都出现了问题:可以编译生成程序,但是不能调试,一启动调试,就出现“未正确初始化 GDI+ (内部 GDI+ 错误)。”,是在窗体InitializeComponent时提示的错误。
将vs2012补丁更新到update 3,仍然显示同样的错误,不能调试。
安装vs2013预览版,错误提示一摸一样。
求高人指点!怎样消除这个错误。百度,google都没能找到办法解决。
下面是异常的详细内容
未处理System.Runtime.InteropServices.ExternalException
Message=未正确初始化 GDI+ (内部 GDI+ 错误)。
Source=System.Drawing
ErrorCode=-2147467259
StackTrace:
在 System.Drawing.Graphics.FromHdcInternal(IntPtr hdc)
在 System.Drawing.Font.ToLogFont(Object logFont)
在 System.Drawing.Font.ToHfont()
在 System.Windows.Forms.Control.FontHandleWrapper..ctor(Font font)
在 System.Windows.Forms.Control.get_FontHandle()
在 System.Windows.Forms.ContainerControl.GetFontAutoScaleDimensions()
在 System.Windows.Forms.ContainerControl.get_CurrentAutoScaleDimensions()
在 System.Windows.Forms.ContainerControl.get_AutoScaleFactor()
在 System.Windows.Forms.ContainerControl.PerformAutoScale(Boolean includedBounds, Boolean excludedBounds)
在 System.Windows.Forms.ContainerControl.OnLayoutResuming(Boolean performLayout)
在 System.Windows.Forms.Control.ResumeLayout(Boolean performLayout)
在 titleChange.Form1.InitializeComponent() 位置 f:\Source\titleChange\Form1.Designer.cs:行号 122
在 titleChange.Form1..ctor() 位置 f:\Source\titleChange\Form1.cs:行号 16
在 titleChange.Program.Main() 位置 f:\Source\titleChange\Program.cs:行号 17
在 System.AppDomain._nExecuteAssembly(Assembly assembly, String[] args)
在 Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
在 System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
在 System.Threading.ThreadHelper.ThreadStart()
InnerException:
只能重装了,VS2012重装,然后达到UPDATE4