Ayende @ Rahien

Unnatural acts on source code

MonoRail & App_GlobalResources

One on the nicer semantics of App_GlobalResources is that it is updated on the fly. I wanted to use it with MonoRail, but I wasn't quite sure how. A minute's search turned out that this syntax works:

[Resource("msgs", "Resources.Messages",
	AssemblyName = "App_GlobalResources")]
[Resource("err", "Resources.Errors",
	AssemblyName = "App_GlobalResources")]
public abstract class BaseController : SmartDispatcherController
{
}

Comments

c.sokun
01/02/2008 08:04 AM by
c.sokun

Ayende, I tried to follow your step however I got and error like this

Could not find any resources appropriate for the specified culture or the neutral culture. Make sure "Resource1.resources" was correctly embedded or linked into assembly "App_GlobalResources.nou-xmu6" at compile time, or that all the satellite assemblies required are loadable and fully signed.

Do you have any sample for this post to share?

c.sokun
01/02/2008 08:14 AM by
c.sokun

Oh, I got it my mistake once app compile all resource will be group with Resources namespace, so if my resource name in App_GlobalResources call Errors then I had to references it as Resources.Errors

Thanks for your the suggestion.

Comments have been closed on this topic.