Monday, April 21, 2008

Exception Messages on Microsoft .NET Compact Framework 3.5

Exception Messages on .NETCF 3.5

Martijn Hoogendoorn provides a description of how to avoid the message:-

"An error message is available for this exception but cannot be displayed because these messages are optional and are not currently installed on this device. Please install 'NETCFv35.Messages.EN.wm.cab' for Windows Mobile 5.0 and above or 'NETCFv35.Messages.EN.cab' for other platforms. Restart the application to see the message."

Even if you have installed the cab file with message resources.

Source: Peter Foot

Fixing Exception Messages on the .NET Compact Framework 3.5

I recently ran into trouble while developing for the .NET Compact Framework, v3.5. Upon all exceptions, the framework would tell me:

"An error message is available for this exception but cannot be displayed because these messages are optional and are not currently installed on this device. Please install 'NETCFv35.Messages.EN.wm.cab' for Windows Mobile 5.0 and above or 'NETCFv35.Messages.EN.cab' for other platforms. Restart the application to see the message."

Interpreting the message as 'I have to run the NETCFv35.Messages.EN.wm.cab (I'm developing an application for WM6) on my device', I copied the file from C:\Program Files (x86)\Microsoft.NET\SDK\CompactFramework\v3.5\WindowsCE\Diagnostics onto my mobile device and ran the installation.

To no avail, nothing changed and I was stuck. After installing the 'Power Toys for .NET Compact Framework 3.5', however, I configured logging using the '.NETCF Logging Configuration' application and found the following error for the loader log:

'Attempt to load [\Program Files\SomeApp\System.SR.dll] has failed (err 0x80001000).'

Renaming the file 'SYCCFA~1.001', included in the aforementioned CAB file into System.SR.dll and adding it as a reference in my application proved to fix the issue. I now had readable exception messages.

Just jotting this down as there's nothing to be found on the web regarding the issue that I could find.

Source: Martijn Hoogendoorn

No comments: