swnuwangyun-曲终人散成一梦,繁华落尽原是空

专注于:移动设备(Windows Mobile),射频识别(RFID, EPC),嵌入式系统。还有技术攻关,呵呵!

  博客园 :: 首页 :: 新随笔 :: 联系 :: 订阅 订阅 :: 管理 ::
  55 随笔 :: 1 文章 :: 104 评论 :: 5 引用

There has been some confusion about the error message: "Could not find resource assembly". Basically, this means that there is some exception that has happened in the program. The error did not happen because it could not find the resource assembly. The resource assembly that it is searching for contains exception messages (strings) that would be helpful in debugging what went wrong with the program.

  Since the user is never expected to see this error message if the program works as expected and all exceptions are handled appropriately, it was decided (due to size constraints) that the resource assembly that has these error strings are never put on a user's device. Thus the main target audience of these error strings are developers who would like to debug issues. Hence, when you do an F5 deploy onto the device, the System.SR.dll assembly which have these error strings are copied to the device and the developer can see the error messages. But in case .Net Compact Framework is installed from a redistributable or you are using .Net Compact Framework that come with the device (as a user of the device would be doing), the System.SR.dll is not present on the device. Hence, if the application did come upon an exceptional condition that wasn't handled by the application, this "Could not find resource assembly" message would be shown to the user.

If you are not using Visual Studio F5 deploy to the device and would still like to see the exception messages, you can achieve this by taking the System_SR_[Language].CAB  where [Language] corresponds to the language in which you want to see the error message to appear and clicking on the cab file to install it. For more information on how to do this, see the following link:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dv_evtuv/html/etconerrormessagecannotloadresourceassembly.asp

PS: I made the same mistake again and again. Last time when in scanomat project, i find this problem from customer's feedback, it takes too much time to find and fix this bug. Arround one year later when in the new project, i met the same bug again, but luckly i remembered it quickly.

Installation of the System_SR_[Language].CAB  is very easy, the link given above is invalid now, you can find the file in "C:\Program Files\Microsoft Visual Studio 8\SmartDevices\SDK\CompactFramework\2.0\v2.0\WindowsCE\Diagnostics", for any language.

posted on 2007-08-23 16:54 swnuwangyun 阅读(99) 评论(0)  编辑 收藏 所属分类: 移动开发资料查阅

标题  
姓名  
主页
Email (博主才能看到) 
验证码 *  看不清,换一张 [登录][注册]
内容(请不要发表任何与政治相关的内容)  
  登录  使用高级评论  新用户注册  返回页首  恢复上次提交      
该文被作者在 2008-08-13 11:31 编辑过


相关链接: