IrDAClient throws InvalidProgramException

G

Guest

In Whibey, I have created a regular WinForms project, and added a reference
to the dll at the path "C:\Program Files\Microsoft Visual Studio
8\SmartDevices\SDK\CompactFramework\2.0\WindowsCE\System.Net.IrDA.dll".

In my Form2.cs, I have the following code:

public Form2()
{
InitializeComponent();

IrDAClient iraClient = new IrDAClient();
MessageBox.Show(iraClient.RemoteMachineName);
}

When I run this application, it gives me an exception:
System.InvalidProgramException was unhandled
Message="Common Language Runtime detected an invalid program."
Source="System.Net.IrDA"
StackTrace:
at System.Net.Sockets.IrDAClient.get_RemoteMachineName()
at Destiny.Tablet.UI.Form2..ctor() in
C:\TW\destiny\trunk\src\Destiny.Tablet.UI\Form2.cs:line 20
at Destiny.Tablet.UI.Program.Main() in
C:\TW\destiny\trunk\src\Destiny.Tablet.UI\Program.cs:line 16
at System.AppDomain.nExecuteAssembly(Assembly assembly, String[] args)
at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence
assemblySecurity, String[] args)
at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
at System.Threading.ExecutionContext.Run(ExecutionContext
executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()

In fact, when I put a breakpoint after my IrdaClient creation line, I can
already start seeing exceptions from its Quick Watch.
Does anyone know why I am having this issue?

My dev machine is a Dell D600 laptop, with infrared turned on and that it is
able to detect any IR devices nearby.

My OS is Windows XP SP2. I am using Whidbey, .NET Framework 2.0 build 50215.

Can someone please help? Thanks a million...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top