JsLint.vs 8002000b 错误解决方法

    技术2022-05-20  38

    通过重新编译Jslint源代码,得到适合中文VS2008、VS2005的JsLint插件。(将红色代码改为蓝色代码)

    下面是编译方法:

    By debugging your program, i finally figure it out.The reason that causes this problem is localization.You use the following code to retrieve the name of Tool menu in Connect.OnConnection().//在VS中打开JSLint源代码,找到connect.cs文件,在OnConnection方法中找到下面代码。

     

    ResourceManager resourceManager = new ResourceManager("CPBrowser.CommandBar", Assembly.GetExecutingAssembly());

    CultureInfo cultureInfo = new System.Globalization.CultureInfo(m_dte.LocaleID);

    string resourceName = String.Concat(cultureInfo.TwoLetterISOLanguageName, "Tools");

    toolsMenuName = resourceManager.GetString(resourceName);

     

    The following are the values of each related variables at run-time:

    m_dte.LocaleId = 2052cultureInfo.TwoLetterISOLanguageName = "zh"resourceName = "zhTools"toolsMenuName = null

     

    There's no definition of "zhTools" in CommandBar.resx, just "zh-CHS" and "zh-CHT". so, it's evident that the program cannot execute normally.I've tried to fix this issue by modifing your code. I changed cultureInfo.TwoLetterISOLanguageName to cultureInfo.Name, but the problem is still. Because the value of cultureInfo.Name is "zh-CN", not the expecting value "zh-CHS". But I found the cultureInfo.Parent representing the "zh-CHS". So I modified the code as following, and it now works well.

    //将以上的代码改为下面代码CultureInfo cultureInfo = new System.Globalization.CultureInfo(_applicationObject.LocaleID);

    if (cultureInfo.LCID == 2052)   

           cultureInfo = cultureInfo.Parent;

    string resourceName = String.Concat(cultureInfo.Name, "Tools");

    toolsMenuName = resourceManager.GetString(resourceName);

     

    I think this is not the final solution to solve the problem. I'm not familiar with software localization, maybe someone can do this better.

    //下面是如何调试JS文件follow the steps below:

    1. open properties window of the project.//打开项目的属性面板2. select Debug tab.//找到“调试”面板3. select Start External Program.//在启动操作下,选择“启动外部程序”4. click the ellipsis button and select the Visual Studio executable file. (vs_install_dir/Common7/Ide/devenv.exe)//点击右侧的路劲选择按钮,找到VS的安装位置,然后选择devenv.exe(一般默认就在VS安装目录下)5. press F5 to start debugging.//按下“F5”键进行调试

     


    最新回复(0)