locked
couldn't find resource assembly RRS feed

Answers

  • The error occurs when the localized assembly with the error messages can't be found on the device. If you install the System.SR cab for your language then this error message should go away (well actually it allow you to see the localized error message for what went wrong in the first place). With VS installed all the SR cabs can be found here:

    Program Files\Microsoft Visual Studio 8\SmartDevices\SDK\CompactFramework\2.0\v2.0\WindowsCE\Diagnostics

    Generally VS should install the SR cab when you deploy your solution, but for now you can just copy it to the device yourself and run it there. The cabs are named System_SR_<language> for non windows mobile devices and System_SR_<language>_wm for windows mobile devices so just pick whatever one you need. Hope that helps,

       -Noah

    .Net Compact Framework

    Monday, May 22, 2006 6:26 AM

All replies

  • The error occurs when the localized assembly with the error messages can't be found on the device. If you install the System.SR cab for your language then this error message should go away (well actually it allow you to see the localized error message for what went wrong in the first place). With VS installed all the SR cabs can be found here:

    Program Files\Microsoft Visual Studio 8\SmartDevices\SDK\CompactFramework\2.0\v2.0\WindowsCE\Diagnostics

    Generally VS should install the SR cab when you deploy your solution, but for now you can just copy it to the device yourself and run it there. The cabs are named System_SR_<language> for non windows mobile devices and System_SR_<language>_wm for windows mobile devices so just pick whatever one you need. Hope that helps,

       -Noah

    .Net Compact Framework

    Monday, May 22, 2006 6:26 AM
  • Hey, Not sure if this is any use, we had the same problem. VS2005 deploys the resources CAB (System_SR_ENU ) but the error strings don't display. (target device is 2003SE btw)
     
    However, changing the device region from English (Australia) {where we are...} to English (US) {where we're not...} fixed this. We can now see the missing error messages. Changing it back gives us the 'missing resource' error.
     
    I guess we just dont talk proper English downunder
     
     
    Friday, June 9, 2006 2:58 AM
  • But what if there is no resource file for your language? My device runs  'Dutch' locale settings, there is no cab file for dutch as far as I can see... How can I tell the project to use ENU (english/us) error messages? Anything is better then a message in dutch saying it can't find resource assembly.

    It gets even better now :) I changed my locale settings to ENU, this shows the 'error' I get in english.

     

    "An error message cannot be displayed because an OPTIONAL resource assembly containing it cannot be found"

    How can I solve this? If I run the project on my phone it shows the above message, when I run the project in emulator mode, having VS emulate a mobile 5 device, it does show the correct error messages....

     

    Any help would be appreciated.

     

    Greetz, TR

    Saturday, December 2, 2006 2:12 PM
  • You'd need to install that optional resource assembly by installing System.SR.cab as Noah suggested above. If there's no CAB for your specific locale go ahead and install English one so English messages would be shown.

    By the way both "Can't fined resource assembly" and "An error message cannot be displayed because..." are exactly the same and shown for the same reason. First one was used in NETCF V1 (so you'd need to install NETCF V1 SR CAB) and second one is from NETCF V2 (so you'd need to install NETCF V2 SR CAB).

    Saturday, December 2, 2006 6:35 PM
  • Exists there a solution which really works?

    I never had this problem on old devices (e.g. PPC2002 using CF 1.0).

    On newer devices (e.g. WM2003, WM5, WM6) I tried to installed both German and English version of System.SR.dll but it not helped to solve the problem (I know that it simply does not find the text resources for error messages).

    For example: I have an CF 1.0 application (English language) running on a German WM5 device (installed CF 2.0 only). Application works fine in this environment.

    Should I install the CF1.0 assembly of System.SR.dll or CF 2.0?
    Sunday, July 13, 2008 8:58 PM
  • Believe it or not but I never had this problem - ever. But then again, I never even tried to install the DLL but just let VS to install SR CAB file for me which would automatically match the framework version.

     

    So you should install the _CAB_ file which matches framework version. E.g. if you have NETCF V2 SP1 on the device then SR CAB should be from 2.0 SP1 and not from any other version.

     

    Since messages are coming from the framework they should match the framework version application is running against and not the version application was compiled against.

     

     

    Monday, July 14, 2008 1:34 AM
  •  Ilya Tumanov wrote:

    Believe it or not but I never had this problem - ever. But then again, I never even tried to install the DLL but just let VS to install SR CAB


    I believe it !  But there is a difference when only pressing F5 and let VS do everything for you or if you deploy an application using .CAB files. In development environments everything may work fine. But there are millions of devices out there where an appliction may run and then you get "problems" which never had on your development device ...



     Ilya Tumanov wrote:

    So you should install the _CAB_ file which matches framework version. E.g. if you have NETCF V2 SP1 on the device then SR CAB should be from 2.0 SP1 and not from any other version.

     

    Since messages are coming from the framework they should match the framework version application is running against and not the version application was compiled against.



    That's a good hint. But how can a user determine which SP of CF is installed on his device. Under Add/Remove progams there isn't the information + I can't tell all users to find a special .dll file etc.
    Monday, July 14, 2008 6:52 AM
  • Launch \windows\cgacutil.exe and it would tell you installed version.

    Generally you should know which SP is installed on the device because you should install it (and not rely on some version been on the device).

     

    • Proposed as answer by sarina raiyan Tuesday, June 9, 2009 12:39 PM
    Monday, July 14, 2008 4:03 PM
  •  Ilya Tumanov wrote:

    Launch \windows\cgacutil.exe and it would tell you installed version.


    Thank you for this hint.!!

     Ilya Tumanov wrote:

    Generally you should know which SP is installed on the device because you should install it (and not rely on some version been on the device).


    Again I am talking about user's devices. I can't know which version and which applications etc. is installed on a customer's device.

    On my development device(s) maybe I know it but I can also forget it if testing lot of Betas, SPs ... etc. So it is necc. to determine what is installed on the device.
    Monday, July 14, 2008 4:41 PM
  • It's your responsibility to ship whatever version of NETCF you're developing for with your application and install it on to user's devices. This way you know for sure:

     

    1.     They have NETCF at all.

    2.     That’s the NETCF you’re testing against and not some random version.

     

    It’s like shipping DirectX binaries with your game or shipping C++ runtime with your C++ application. If you’re relying on some random version been there you will run into trouble - you already have actually as your post would suggest.

    Monday, July 14, 2008 5:54 PM
  •  Ilya Tumanov wrote:

    It's your responsibility to ship whatever version of NETCF you're developing for with your application and install it on to user's devices. This way you know for sure:

     

    1.     They have NETCF at all.

    2.     That’s the NETCF you’re testing against and not some random version.

     



    Believe it or not there are still PPC2002 devices out there. Even on those devices my applications will work (CF 1.0 of course or eMbedded Visual C++ applications).


    Ah, ok so it is also Microsoft's resposibility which Windows Version and .NET version is installed on their million of customers PC's, mobile devices etc.


    If I ship an application I can make a recommendation which version of OS and CF etc. is a pre-requisite to run one of my applications but it is not my responsiblity which other stuff ist installed on user's / customer's devices.


    But now we are changing the subject of this thread... We shouldn't do...


    BTW, it should be Microsofts responsiblity that a CF 1.0 or .NET 1.1 application still runs under CF 2.0 or .NET 2.0 or .NET 3.5 ... Backward compatibility, you know? No DLL *** under .NET, you know?

     Ilya Tumanov wrote:

    some random version been there you will run into trouble - you already have actually as your post would suggest.



    Your suggestion isn't true . I just liked to know why (some!) exception messages (System.SR.dll) isn't delivered by default. Under CF 1.0 the exception messages were delivered (name of exceptions). This was, of course, because of limitited resources on mobile devices (in the past). But now devices have more and more memory, faster CPUs and the "CF Team" decided that it is not necc. to deliver all Exception messages because "some exceptions" will never occur or shouldn't occur on customers devices.

    But this is the theoretical part of it of course. In real world there is a difference. Even .NET Microsoft applications suffers from some exceptions and the user get's no good error messages.

    Just found: http://www.codeplex.com/Wiki/View.aspx?ProjectName=NetCFWinCE200
    (ok, it is another platform (HPC) but CF 1.0 on a Windows CE 2.0 device sounds amazing)

    Tuesday, July 15, 2008 6:40 AM
  • I don’t see how that all relevant. 

    In any case you have your answer. Whatever you want to implement it or not is up to you.

    Tuesday, July 15, 2008 4:52 PM
  •  Ilya Tumanov wrote:
    In any case you have your answer. Whatever you want to implement it or not is up to you.


    Just google for "could not find resource assembly" and you'll see how relevant it is.

     Ilya Tumanov wrote:
    In any case you have your answer. Whatever you want to implement it or not is up to you


    Yes and no. Since the problem ("resource not found" error message) occurs even the correct System.SR.dll is installed on they real (not emulator!) device and not using Visual Studio F5. Soft-Reset does also not solve the issue.

    Btw, I found and fixed the problem for me (real exception was IndexOutOfRange exception or something similar (issue in string operation).

    Many thanks,
    hfrmobile
    Thursday, July 17, 2008 11:00 AM
  • I'm not talking about the issue per se; I'm talking about your flashback to PPC 2002 and NETCF V1. You're forgetting what PPC 2002 shipped without any version of NETCF and it was up to developers to ship NETCF with the application or it would not even start on PPC 2002. Also you're forgetting what exception messages were optional from very begging. It was always up to developer to ship them as well if needed. BTW, "could not find resource assembly" you mentioned is from NETCF V1.

     

    Yes, I've heard about cases like this where it won't work for some reason in this very forum. However I'm yet to see the actual repro.

     

    I suspect you've been printing just Message on exception. This practice is for some reason common and truly puzzling to me. If you do exception.ToString() instead you would get all the information on exception including:

     

    - Exception type

    - Exception message if available

    - Stack trace.

     

    Thursday, July 17, 2008 4:06 PM