How to embed ASP.NET resx files

Last post 05-15-2008 10:29 AM by Frinavale. 2 replies.

Sort Posts:

  • How to embed ASP.NET resx files

    05-13-2008, 11:29 AM
    • Loading...
    • Frinavale
    • Joined on 02-09-2007, 10:15 AM
    • Posts 51

    I'm working on an ASP.NET application that supports French, English, and Spanish.
    I have created many global and local .resx files to support all of the pages in my website and everything is working fine.
    I would now like to embed these into the ASP.NET application DLL for when the application is released.

    I've tried to mark these files as embedded resources, but when I run the application it is unable to find them...
    I have since discovered that you cannot embed .resx files, you can only embed .resources files.
    So I converted the .resx files into .resources files using the ResGen.exe tool, and then embedding these resource files into the application which also didn't work.
    I tried using the Al.exe tool to link the resource files...but still had no luck.

     
    So I'm back to square one...I have a bunch of .resx files supporting the localization of my ASP.NET application and have no idea how to embed these resources into the compiled DLL for when I release the application. 

     

    I'm looking for any information on how to do this.

    Thank you for your time!

    -Frinny 

  • Re: How to embed ASP.NET resx files

    05-13-2008, 8:13 PM
    • Loading...
    • vivek_iit
    • Joined on 06-18-2006, 6:13 PM
    • New Delhi
    • Posts 2,926
    • TrustedFriends-MVPs

    Hi,

    Try to see if this link helps: http://forums.asp.net/t/1190889.aspx

    Vivek 

    MVP, ASP.NET || My Website || Blog || Articles

    Please mark the most helpful reply/replies as "Answer".
  • Re: How to embed ASP.NET resx files

    05-15-2008, 10:29 AM
    • Loading...
    • Frinavale
    • Joined on 02-09-2007, 10:15 AM
    • Posts 51

    Thanks for the link Vivek but it was no help to me. I have a whole bunch of web user controls (ASCX) and ASPX pages in my project that all have .resx files which contain prompts/error messages/images etc.
    The ASPX and ASCX pages use these resources like so:

    <asp:LinkButton ID="switchToFrench" runat="server" Text="<%$ Resources:GlobalResource, French %>" style="color:LightGrey;" ></asp:LinkButton>|
     <asp:LinkButton ID="switchToEnglish" runat="server" Text="<%$ Resources:GlobalResource, English %>" style="color:LightGrey;" ></asp:LinkButton

    <asp:label style="display:block; height:100px; line-height:90%; height:90%; font-size:xx-large; clear:both; color:PowderBlue;" ID="welcome" runat="server" Text="Welcome" meta:resourcekey="welcomeResource"></asp:label>

     

    I don't know the term for this technique I'm using for globalization, but it's very effective.
    As it stands right now the resource files for my project are stored as .resx files and from what I understand these are compiled into .resources files at run time (much like the ASPX pages are compiled at runtime). I like the benefits that result from this on-the-fly compilation (it combines the resource culture requested with the base resource in order to create a .resources file that contains all the resources required if some are missing from the requested resource culture).  However, my requirements have changed.

    I need to create a satellite assembly for my web application.  I need to convert all of the .resx files in my project into .resources files and compile them into a satellite assembly. I just don't know how to do this and need some guidance. I know that I somehow have to use the Resgen.exe and Al.exe tools to create my satellite assembly but I haven't been successfully able to use these tools yet.

    I have not been able to find a good article/tutorial on how to do this and I'm hoping that someone knows how to get me pointed in the right direction.

    So far I've created a new project and have followed a few articles I've found by googling in attempt to learn about satellite assemblies; however I have had no luck in getting my project to use the satellite assemblies I have created (I don't even know if they were created properly).

    If you know of any good articles/tutorials...I'd greatly appreciate it. 

    Thanks again for your help.
     

    -Frinny 

Page 1 of 1 (3 items)