Results 1 to 3 of 3

Thread: [RESOLVED] [Smart Device Project] Missing Optional Resource Assembly

  1. #1

    Thread Starter
    PowerPoster
    Join Date
    Jul 2006
    Location
    Maldon, Essex. UK
    Posts
    6,334

    Resolved [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 ?

  2. #2
    Angel of Code Niya's Avatar
    Join Date
    Nov 2011
    Posts
    9,017

    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.
    Treeview with NodeAdded/NodesRemoved events | BlinkLabel control | Calculate Permutations | Object Enums | ComboBox with centered items | .Net Internals article(not mine) | Wizard Control | Understanding Multi-Threading | Simple file compression | Demon Arena

    Copy/move files using Windows Shell | I'm not wanted

    C++ programmers will dismiss you as a cretinous simpleton for your inability to keep track of pointers chained 6 levels deep and Java programmers will pillory you for buying into the evils of Microsoft. Meanwhile C# programmers will get paid just a little bit more than you for writing exactly the same code and VB6 programmers will continue to whitter on about "footprints". - FunkyDexter

    There's just no reason to use garbage like InputBox. - jmcilhinney

    The threads I start are Niya and Olaf free zones. No arguing about the benefits of VB6 over .NET here please. Happiness must reign. - yereverluvinuncleber

  3. #3

    Thread Starter
    PowerPoster
    Join Date
    Jul 2006
    Location
    Maldon, Essex. UK
    Posts
    6,334

    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
    Last edited by Doogle; Nov 6th, 2012 at 02:44 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width