Support for App_[Local|Global]Resources coming?

Last post 05-04-2006 7:13 PM by timmcb. 4 replies.

Sort Posts:

  • Support for App_[Local|Global]Resources coming?

    04-18-2006, 10:23 PM
    • Member
      115 point Member
    • drub0y
    • Member since 08-21-2003, 11:40 AM
    • NYC, NY
    • Posts 26

    Is support for the App_LocalResources and App_GlobalResources directories coming soon?

    I had done a bunch of research with Web Site Projects back in the day to convert from our custom localization code to use the resource expression and when I went to apply it to my web application project today I was suprised to find support for these concepts weren't there yet.

    I hope they're planned...? Confused [*-)]

    Thanks,
    Drew

    Chief Software Architect
    Mimeo.com, Inc. - http://www.mimeo.com
  • Re: Support for App_[Local|Global]Resources coming?

    04-19-2006, 11:45 AM
    • Contributor
      2,365 point Contributor
    • timmcb
    • Member since 11-04-2002, 11:29 AM
    • Redmond, WA
    • Posts 469
    • AspNetTeam

    I'm currently working on some improvements in this area for the next release.  However, GenerateLocalResources/App_LocalResources should work with the current release.  Also, App_GlobalResources works for the most part.  The one thing that you can't do is access global resources with strong types in code behind files.  You can, however, access them with strong types in server script blocks.  Also, resource expressions work fine.

    The improvement I've added so far are these:

    • Menu commands for adding App_GlobalResources and App_LocalResource folders
    • .resx files added to App_LocalResources set with BuildAction="Content" and CustomTool=""
    • .resx files added to App_GlobalResources set with BuildAction="Content" and CustomTool="GlobalResourceProxyGenerator"
    • .resx added to other project directories work just like client libraries -- the BuildAction="EmbeddedResource" and CustomTool="ResXFileCodeGenerator"
    • The GlobalResourceProxyGenerator creates file.designer.cs files nested behind neutral culture .resx files that provide strong type access to resources in App_GlobalResources.  For instance: string str = Resources.Resource1.String1;

    We may change design somewhat.  I'm thinking of getting rid of the GlobalResourceProxyGenerator CutomTool and instead generating the custom proxies without having to set a tool.  I might also place the proxies under Properties/MyProject folders.  Another thought is to create a proxy assemby reference so that at run-time the strong types are accessed directly instead of through the proxy.

    If you have any suggestions or know of other things that don't work as expected please let me know.

    Tim McBride

    This posting is provided "AS IS" with no warranties, and confers no rights.
  • Re: Support for App_[Local|Global]Resources coming?

    04-19-2006, 11:56 AM
    • Member
      115 point Member
    • drub0y
    • Member since 08-21-2003, 11:40 AM
    • NYC, NY
    • Posts 26

    Awesome, thanks for the response. I had a feeling it might still work despite the fact that the project type didn't treat them as first class citizens yet. I should have just tried, but either way I felt that I should find out what you guys have planned (if anything) for this.

    Very glad to hear you're working on rounding these features out though. If anything else comes to mind I'll definitely be sure to post. ;)

    Cheers,
    Drew

    Chief Software Architect
    Mimeo.com, Inc. - http://www.mimeo.com
  • Re: Support for App_[Local|Global]Resources coming?

    05-04-2006, 6:14 PM
    • Member
      148 point Member
    • aivanoff
    • Member since 02-28-2006, 5:08 PM
    • Posts 45
    Is there a way to build App_GlobalResources and App_LocalResources with BuildAction="EmbeddedResources"?
    Alex
  • Re: Support for App_[Local|Global]Resources coming?

    05-04-2006, 7:13 PM
    • Contributor
      2,365 point Contributor
    • timmcb
    • Member since 11-04-2002, 11:29 AM
    • Redmond, WA
    • Posts 469
    • AspNetTeam

    Doing that to App_LocalResources would break pages.  Doing that to App_GlobalResources would break pages that use resource expressions.  So, this is not recommended.  However, you can still add resources elsewhere in your project with BuidAction="EmbeddedResources" and access them from you code.

    Tim McBride

    This posting is provided "AS IS" with no warranties, and confers no rights.
Page 1 of 1 (5 items)