I would like to do client side localization (i.e embedding the javascript and resource files). Everything was working fine until we had both the js file and the resource file in the same project("XXX.Web").
As a part of a requirement, I had to move out all the resource files to "XXX.LocalizedResources" project, while I still need to do client side localization for the js file.
I tried the following in the AssemblyInfo.vb of the Web project:
Before:
Assembly: System.Web.UI.WebResource("XXX.Web.GlobalStrings.js", "text/javascript")
Assembly: System.Web.UI.ScriptResource("XXX.Web.GlobalStrings.js", "XXX.Web.Resources", "Resources")
After:
Assembly: System.Web.UI.WebResource("XXX.Web.GlobalStrings.js", "text/javascript")
Assembly: System.Web.UI.ScriptResource("XXX.Web.GlobalStrings.js", "XXX.LocalizedResources.Resources", "Resources")
(Please ignore the syntactical errors in the above lines ) And the error I get now is the following:
Could not find any resources appropriate for the specified culture or the neutral culture. Make sure "XXX.LocalizedResources.Resources" was correctly embedded or linked into assembly "XXX.Web" at compile time, or that all the satellite assemblies required are loadable and fully signed.
From little researching I came across that only web or web.extension projects could be used in "Assembly: System.Web.UI.ScriptResource (...)".
I tried adding "Assembly: InternalsVisibleTo("XXX.Web")" in AssemblyInfo of "XXX.LocalizedResources" but that doesn't help in making the resource file open to "XXX.Web". Also the resource files are already public and embed option is set too.
Any idea how I could embed an external resource file into a javascript for client side localization?