[RESOLVED] [Smart Device Project] Missing Optional Resource Assembly
I have C/S Project where the Client is an old HP Pocket PC. When connecting the Client, if the Server is not running, for example, I attempt to catch the exception and output something meaningful:
Code:
Try
'
' Use a blocking connection request
' since nothing can happen until we're connected
'
Client.Connect(txtHost.Text, CInt(txtPort.Text))
'
' Connected OK
' Set the UI appropriately
' and start an asynchronous read
'
btnSend.Enabled = True
btnConnect.Enabled = False
Call Receive(Client)
Catch ex As Exception
MessageBox.Show("Unable to Connect: " & ex.Message)
Me.Close()
End Try
Under such circumstances I receive: "Unable to Connect: An error message can not be displayed because an optional resource assembly containing it cannot be found"
I'm building the Project and CAB file and deploying to the device OK (I think). Does anyone have any ideas what I have to do to 'include' this optional resource assembly ?
Re: [Smart Device Project] Missing Optional Resource Assembly
You're probably using a compact version of the framework on the mobile device which may exclude some string resources. You should be able to get around it by specifying some kind of error message yourself. I'm going to venture a guess and say that its a SocketException being thrown. These have also have a socket error code so you can derive your own error message based on that if you want.
Re: [Smart Device Project] Missing Optional Resource Assembly
Thanks for the suggestion.
In case anyone else has a similar problem, after Googling around, I found the solution:
There's CAB files named 'System_SR_XXX' in 'C:\ProgramFiles\Microsoft.NET\SDK\CompactFramework\v2\WindowsCE\Diagnostics\' Where XXX is a language code (e.g. ENU). That seems to be the correct one for an ARM platform.
Just copy the appropriate one to the Smart Device and install it. I guess it's not installed as part of the Framework automatically to keep the size down. (or perhaps I missed an Option when it was installed) Anyway, I now get 'meaningful' messages.
BTW There's also CAB files in 'C:\ProgramFiles\Microsoft.NET\SDK\CompactFramework\v3.5\WindowsCE\Diagnostics\' in the form 'NETCFv3.5.Messages.XX' where XX is a Language code (e.g. EN) which I assume are for the 3.5 Framework.
Within those Folders are also CAB file such as 'System_SR_XXX_wm' which I guess are for a different target platform