Well apparently Localization of error messages isnt as straightforward. You are supposed to add a resource file to the MyApp.Web project, that is the asp.net site that hosts your silverlight app, then add that resource to the silverlight app, then you will be able todo the code you stated in your question after some tweaks, follow the instructions below
This section explores how error
messages can be localized by storing
them in resource files and sharing
them across tiers.
The example uses .NET RIA Services
walkthrough project as the base
project and builds on top of it.
Let s say we want to add a validation
error as a resource for LoginID field.
Create a new ‘Resources folder in the HRApp.Web project
(server project)
Add a new resource file to this folder and name it
ValidationErrorResources.resx
Double click on the .RESX file to bring up resource designer
page
Add a new string resource with Name= LoginIDValidationError and
Value= "LoginID field is required"
Change the access modifier to ‘Public by clicking on the ‘Access
Modifier drop down UI and selecting
‘Public and save the project. This
generates a ValidationErrorResources
class in the HRApp.Web.Resources
namespace.
Open ‘OrganizationService.metadata.cs file
and add the following ‘Required field
validation to LoginID member. Specify
the error message resource name and
resource type values by setting the
corresponding attribute members as
shown below.
[Required(ErrorMessageResourceName =
"LoginIDValidationError",
ErrorMessageResourceType =
typeof(ValidationErrorResources))]
public string LoginID;
Now we want to share this resource
file in the Silverlight project
(client project). To do this,
Create a folder WebResources in the HRApp project
(folder structure must match the
resource file namespace on the server
side)
Select Resources folder and bring up Add Existing file dialog,
browse to the server side resource
file folder location
Select ValidationErrorResources.resx and
ValidationErrorResources.designer.cs
files, and add them as link files to
the Silverlight project. Save the
project file
Open HRApp.csproj file in notepad , locate the section where
.designer.cs file is included and add
the highlighted 3 lines to this
section
<Compile
Include="..HRApp.WebResourcesValidationErrorResources.Designer.cs">
<AutoGen>True</AutoGen>
<DesignTime>True</DesignTime>
<DependentUpon>ValidationErrorResources.resx</DependentUpon>
<Link>WebResourcesValidationErrorResources.Designer.cs</Link>
</Compile>
Now whenever the validation fails for
the LoginID field the error message
from the resource file is shown to the
user. The resource file can now be
customized to store locale specific
error messages.