问题 I need to develop localizable Addin

  • Friday, February 24, 2012 1:38 PM
     
      Has Code

    Hi,

           I have created an Autodesk Inventor Add-In, now I am trying to localize this Add-In.

    I have gone through hunderd of articals on how to create "Satellite Assembly".

    But all "Satellite Assembly Examples" are either "Windows form based Application" (standalone App)

    or something similar. 

          My addin contains Windows-forms resouces too, and some other resource file which

    must be localized. 

    I have created setellite assembly as below for "en-AU" culture

    1) resgen ABC.resx ABC.en-AU.resources

    2) al /t:lib /embed:ABC.en-AU.resources /culture:en-AU /out:AddIn.resources.dll

    3) and then placed "AddIn.resources.dll" into bin/en-AU/ folder of Autodest Inventor

    I am tring to consume this satellite assembly as follows

    System.Resources.ResourceManager resMgr;
    System.Globalization.CultureInfo ci = System.Threading.Thread.CurrentThread.CurrentCulture;
    System.Threading.Thread.CurrentThread.CurrentUICulture = new System.Globalization.CultureInfo("en-AU");
    try
    {
        resMgr = new System.Resources.ResourceManager("AddIn.ABC", Assembly.GetExecutingAssembly());
        string testLabel = resMgr.GetString("LBL_NAME");
        string testLabel2 = resMgr.GetString("BUTTON_NAME");
    }
    catch (System.Exception ex)
    {
        string exceptionMsg = ex.Message;
    }

    but this gives me exception as "MissingManifestRecourseException"

    It will be really appreciated if anybody help me, and point what i am missing

    or Is it like localization cannot be achieved in Addin ? 

    Please note: I am very much sure that i am able to use resources from Addin.dll

    but till now i am unable to read resources from AddIn.resources.dll

    I tried to load AddIn.resources.dll mannually as

    resMgr = new System.Resources.ResourceManager("AddIn.ABC", Assembly.LoadFrom(@"D:\AddIn.resources.dll"));

    but it dint heklp either.

    Thanks in advance

    ------------------------------------------------

    AlexanderGr8



All Replies

  • Tuesday, February 28, 2012 1:50 AM
    Moderator
     
     

    Hi Alexander,

    Welcome to the MSDN forum.

    We're doing research on this issue. It might take some time before we get back to you.


    Bob Shen [MSFT]
    MSDN Community Support | Feedback to us

  • Sunday, April 01, 2012 6:01 AM
     
     

    It sounds that you encounter similar issue that described by KB839816 (http://support.microsoft.com/kb/839861):

    This problem occurs if you use a localized resource that exists in a satellite assembly that you created by using a .resources file that has an inappropriate file name. This problem typically occurs if you manually create a satellite assembly.

    To manually create a satellite assembly, you must first run the Resource File Generator (Resgen.exe), and then you must run the Assembly Linker (Al.exe). When you run Resgen.exe, if you do not specify the file name of the output file while you convert an XML-based resource format (.resx) file to a .resources file, Resgen.exe creates a .resources file that has the same file name as the input file. If the file name of your XML-based resource format file does not start with the namespace name of your application, the file name of the .resources file will not contain this namespace name either. You may run Al.exe to create a satellite assembly that contains the localized resources that exist in the .resources file. However, when you try to access a localized resource that exists in the satellite assembly, the behavior that is mentioned in the "Symptoms" section occurs.


    Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.

    Regards,
    Eric Yang
    Microsoft Online Community Support