468,290 Members | 2,044 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,290 developers. It's quick & easy.

resources in separate assembly - ugly :(

Hi.
We have a resource assembly that is separate and is used by a class
library assembly, a web app, web service set (all in separate
projects). Windows app is also potentially possible.

First of all, VS2005 generates resource wrappers as internal, so we
have to use InternalsVisibleTo to make intellisense etc possible for
resources.
Then, with this model, all the cool localization features of ASP.NET
2.0 are not possible. Is there any way to circumvent this and take
advantage of automatic resource binding, <$ expressions etc if
resources reside in a different assembly?

Dec 24 '06 #1
1 2171
I don't think so. ASP.NET's resource mechanism works through custom
compilation of the raw RESX files and referencing them through a more or
less custom scheme (the resources get compiled into a special resource
assembly with a dynamic name that the provider reads out of). I'm not aware
of a way to extend that to include external resources.

However, nothing is stopping you from calling external resource assemblies
directly through a ResourceManager.You could build your own expression
parser that read resources from external assemblies. The <$ $parsing is
extensible in .NET and you can certainly create your own mechanism for it.

Although that may not be worth it - it's just as easy to use a standard
class expression in the page and make a static method call and call it from
the page:

<%= App.Trans("ResourceFile","ResourcesId") %>

which would work just as well where App.Trans() would read your resource
from the external resource you've created.

+++ Rick ---
"Sergei Shelukhin" <re******@gmail.comwrote in message
news:11**********************@73g2000cwn.googlegro ups.com...
Hi.
We have a resource assembly that is separate and is used by a class
library assembly, a web app, web service set (all in separate
projects). Windows app is also potentially possible.

First of all, VS2005 generates resource wrappers as internal, so we
have to use InternalsVisibleTo to make intellisense etc possible for
resources.
Then, with this model, all the cool localization features of ASP.NET
2.0 are not possible. Is there any way to circumvent this and take
advantage of automatic resource binding, <$ expressions etc if
resources reside in a different assembly?
Dec 26 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by Derick Smith | last post: by
7 posts views Thread by Ken Allen | last post: by
1 post views Thread by spencermiles | last post: by
reply views Thread by =?Utf-8?B?TWF0dE0=?= | last post: by
reply views Thread by NPC403 | last post: by
2 posts views Thread by MrBee | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.