These are the benefits of each approach:
Benefits of GetGlobalResourceObject (and GetLocalResourceObject ):
- You can specify a specific culture instead of using CurrentCulture.
- You can use a late constraint expression (i.e. a string) to decide which resource to load. This is useful if you cannot know in advance which resource you need to download.
- It works with any type of resource provider. For example, it works not only with an embedded provider based on the RESX standard, but it will work the same way with a database-based provider.
Benefits of strongly typed RESX types:
- You get compile-time errors if you access a resource that does not exist.
- You get Intellisense while working on a project.
So, as with many of the βbestβ questions, the answer is: it depends! Choose the one that has the most benefits for your specific scenarios.
Eilon source share