locked
ScriptResource attribute referencing a resource from satellite assembly RRS feed

  • Question

  • User1070236303 posted

    I have an embedded javascript file in the main assembly of a wap project, I can register this script no problem, I also marked the file as a WebResource:

    [assembly: WebResource( "tree.js", "text/javascript" )]

    Now I want add some localization for this file, so I put in the main project a tree.js.resx file, at the moment I have:

    [assembly: WebResource( "tree.js", "text/javascript" )]

    [assembly: ScriptResource( "tree.js", "tree.js", "Something" )]

    Everything works fine I get localized strings in tree.js (in Something.ResKey form).

    Now I try to move only the tree.js.resx file to a satellite assembly. So I want to use this:

    [assembly: WebResource( "tree.js", "text/javascript" )] // The js file is still in the main assembly.

    [assembly: ScriptResource( "tree.js", "somesatelliteassembly.tree.js", "Something" )] // The localization is in a satellite assembly.

    But this throw an exception, maybe this combination is not supported, any idea would be helpful.

    Here is the exception:

    Could not find any resources appropriate for the specified culture or the neutral culture.  Make sure "somesatelliteassembly.tree.js.resources" was correctly embedded or linked into assembly "mainassembly" at compile time, or that all the satellite assemblies required are loadable and fully signed.

     

     


     

     

    Tuesday, March 10, 2009 1:12 PM

All replies

  • User-922030084 posted

    Hai,

    Did you find the solution for referencing resource from satellite assembly. I am also searching the solution for the same problem.

    If you have found the solution, could you please tell me.

    Thanking you

     

    kavitha 

    Tuesday, May 11, 2010 8:32 AM
  • User-832691735 posted

    Thanks for the reply Sandeep. But you have replied for resx files used in Web Application.

    But I want to know how to use the resx file in ScriptResource Attribute. I am using a javascript file (.js file)which needs the resx file and the javascript file is embedded in my web application.

    [assembly: WebResource( "tree.js", "text/javascript" )] // The js file is still in the main assembly.

    [assembly: ScriptResource( "tree.js", "somesatelliteassembly.tree.js", "Something" )] // The localization is in a satellite assembly.

    It is working when resx file is in same project with javascript file. But now my resx file is another project and I have added a reference of resx file project in my javascript file project . I wanted to use compiled resx file in my javascript file.

     

    Is it possible to reference a compiled resx file in "ScriptResource Attribute"?

    Thank you

     

     

     

    Wednesday, May 12, 2010 4:21 AM