Thursday, 6 June 2013

My .NET Windows Forms app doesn't print in Windows 8!!

It has happened to me, today. A not so old .NET 2.0/3.5 Windows Forms app, from a generally capable and reliable developer. It installs fine in Windows 8, it stars without problems, but clicking on the 'Print' button doesn't do anything. I ran a few tests on my Windows 8 systems and I noticed that it DIDN'T happen on Windows 8 32 bit. So I tried this.

corflags.exe application.exe /32bit+

corflags.exe is an utility from the .NET SDK, I myself got it with the Visual Studio install. Application.exe is a placeholder for the applicatione executable. One needs to use this in an elevated command prompt: it lets the application print again. The utility forces the executable (apparently compiled in anycpu mode) to run in 32 bit mode, and magically printing works again.

This of course will work only with .NET executables.

No comments:

Post a Comment