This code works perfect fine on my winxp32.
When I try to compile it on my vista64 however I get an unhandled exception.
is not a valid Win32 application. (Exception from HRESULT: 0x800700C1)
Make sure the file is a valid assembly.
Make sure you have supplied the correct file path for the assembly.
Any class I try to use from that assembly causes it to throw.
Am I supposed to compile my project some specific way? I've already tried building with the x86 configuration.
static class Program
static void Main()
public class Form1 : Form
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.Text = "Form1";
Device d; //If I comment out this whole line then it works perfectly