Last evening, I was trying to write an application which could detect IR Devices from my machine and give its details. I was using VS2005 Beta 2 Winforms. I added System.Net.IrDA.dll from “C:\Program Files\Microsoft Visual Studio 8\SmartDevices\SDK\CompactFramework\2.0\WindowsCE\System.Net.IrDA.dll” path. The program is simple, just create an instance of IrDAClient and look for devices using IrDA.DiscoverDevices(int max) which gives an array of IrDADeviceInfo. But to my surprise, when I launch the application, it was throwing exception "IrdaClient.DiscoverDevices throws InvalidProgramException".
Reading more about InvalidProgramException exception online, MSDN says "The exception that is thrown when a program contains invalid Microsoft intermediate language (MSIL) or metadata. Generally this indicates a bug in the compiler that generated the program". I was still doubtful if it was really a bug or am I doing something wrong. After working on the code and looking over internet, nothing resolved this issue. Then I thought will log this issue to MSDN Product Feedback Center. While logging the issue, I found it’s already logged and Microsoft Product Team has already confirmed that this is a reproducible at there end and validated it as a bug. Here are the bug details.