The type initializer for "Microsoft.DirectX.DirentInput.Manager" threw an exception.
in the constructor for the class that uses DX. The machines are all XP SP2, which means that DX is installed, although I'm not sure if managed DX gets installed by SP2, the installer won't run as it's there already.
The real worry is, it works fine on my dev machine, and works fine on his machine at home. I've tried with a couple of dll versions ( I have several installed ).
My constructor looks like this :
public JukeboxDXJoystickController(){
foreach(DeviceInstance di in Manager.GetDevices(DeviceClass.GameControl, EnumDevicesFlags.AttachedOnly)){
device =
new Device(di.InstanceGuid);}
if (device == null){
MessageBox.Show("Unable to find attached joystick");
return;}
device.SetDataFormat(DeviceDataFormat.Joystick);
device.SetCooperativeLevel(
null, CooperativeLevelFlags.Background | CooperativeLevelFlags.NonExclusive);device.Properties.AxisModeAbsolute =
true;deviceUpdated =
new AutoResetEvent(false);appShutDown =
new ManualResetEvent(false);device.SetEventNotification(deviceUpdated);
Thread threadLoop =
new Thread(new ThreadStart(this.ThreadLoop));threadLoop.Start();
device.Acquire();
}
I previously used joyGetPos, etc, but they proved to be unreliable in C#. We can still use them and the program runs fine. Any suggestions are most appreciated.

DirectX app crashing
Najeeb
One thing to remember when using managed directX is that you need to make sure that the Assemblies or runtime installed on the client is the same as the one that the application was developed in. For example if I developed and application using the Dec2004 release of Managed DirectX I would need to make sure that the Dec 2004 run time was installed.
I would first have a look at the program and make sure that the correct Assemblies are installed on the client. If you can not rmember what the correct one is you can use reflector to find out.
If you are still having problems I would also report this in the windows gameing forums as there will be more traffic of people who work with the DirectX Systems.