views:

321

answers:

3

I have the following Solution:

  1. SomeProject.Ria (non Silverlight code)
  2. SomeProject.Ria.Silverlight (Silverlight light code, namespace is still SomeProject.Ria)
  3. SomeProject.Ria.MyServices (RIA Services Domain Service)
  4. SomeProject.Ria.MyServices.Proxies (RIA Services Silverlight Generated Code)
  5. SomeProject.Shell (Silverlight Applicaiton)
  6. SomeProject.Web (Web Application)

I would like to use Resource Files for my Annotations on the meta data class in SomeProject.Ria.MyServices.

The format for that appears to be:

[Required(AllowEmptyStrings=false,ErrorMessageResourceName="ThisFieldIsRequired", ErrorMessageResourceType(MyResource))]     

Which project does MyResource belong in? (Assuming that someday I need to support other culture files).

Also the use of the string in here really seems to breed room for error, is it possible to do something like this and still achieve localization, or does this just get compiled into the meta data? If not, how can I get round the resource name being a string?

[Required(AllowEmptyStrings=false,ErrorMessage=MyResources.RequiredMessage)]            
A: 

I was directed to a very recent post from Brad Abrams that outlines what I needed to know:

http://blogs.msdn.com/brada/archive/2010/03/22/silverlight-4-ria-services-ready-for-business-localizing-business-application.aspx

kmacmahon
A: 

I've the following project which uses RIA Services:

SomeProject.Presentation.Silverlight (Silverlight GUI) SomeProject.DomainModel (POCO classes, IRepository and ValidationErrorResources) SomeProject.Application (Web Application)

I followed the post form Brad, but I did place the resource file in the 'SomeProject.DomainModel' and not in the 'SomeProject.Application' project, and it seems that this does not work ? Can someone confirm this ?

Exception=

Could not find any resources appropriate for the specified culture or the neutral culture. Make sure "IssueVision.Data.DomainModel.Resources.IssueVisionResources.resources" was correctly embedded or linked into assembly "IssueVision.Data" at compile time, or that all the satellite assemblies required are loadable and fully signed.

Is the only solution to create a separate library which contains ValidationErrorResources and is referenced by GUI and Server project ??

Stef
A: 

See also this answer

Stef