Why is it so difficult to share resource files (resx) with my Silverlight client?

I am trying to transfer a resource file (.resx file) from my website (RIA Service? Silverlight Host) to a client (Silverlight) by linking the resource file to my client. When I try to access resources using the ResourceManager object, I get the following error:

 System.Resources.MissingManifestResourceException was caught Message=Could not find any resources appropriate for the specified culture or the neutral culture. Make sure "PPCa.Modules.ProjectManager.Client.ViewModels.ResourceStrings.resources" was correctly embedded or linked into assembly "PPCa.Modules.ProjectManager.Client" at compile time, or that all the satellite assemblies required are loadable and fully signed. StackTrace: at System.Resources.ManifestBasedResourceGroveler.HandleResourceStreamMissing(String fileName) at System.Resources.ManifestBasedResourceGroveler.GrovelForResourceSet(CultureInfo culture, Dictionary`2 localResourceSets, Boolean tryParents, Boolean createIfNotExists, StackCrawlMark& stackMark) at System.Resources.ResourceManager.InternalGetResourceSet(CultureInfo requestedCulture, Boolean createIfNotExists, Boolean tryParents, StackCrawlMark& stackMark) at System.Resources.ResourceManager.InternalGetResourceSet(CultureInfo culture, Boolean createIfNotExists, Boolean tryParents) at System.Resources.ResourceManager.GetString(String name, CultureInfo culture) at System.Resources.ResourceManager.GetString(String name) at PPCa.Modules.ProjectManager.Web.Helpers.ResourceHelper.GetEnumText[TResource](ProjectStatus a_projectStatus) InnerException: 

Edit:

When I say that I linked the resource file, I mean that I use the "Add as link" option when adding an existing resx file to my project.

+6
silverlight wcf-ria-services resx
source share
4 answers

I am currently working on this issue. I narrowed the problem down to namespaces. For me, I created the Silverlight Business Application, and I wanted to rename the web project and change its namespace. As soon as I did this, the SL project broke down.

Check this one . The notes in step 5 explain the situation, but I'm currently trying to find a decent way to get around this.

EDIT: This worked for me: http://forums.silverlight.net/forums/p/184013/420509.aspx

+2
source share

A (dubious) decision was as follows:

  • copy (vice link) resx files to the Silverlight client.
  • add "PublicResXFileCodeGenerator" to the Custom Tool property in the gen designer.cs file.
  • Opened the .cs constructor and changed the namespace back to the web designer.cs file.
  • Create a solution to find / configure related issues with the resx namespace.

This worked, but I doubt it is possible to have separate copies of resx files. In addition to having to manually modify resx files, duplicate copies of resx silverlight client copies are duplicated, are there any other potential problems ... or is there an alternative solution.

+2
source share

Explore the Silverlight business application template (create a new project, select the Silverlight business application template).

*. Resx sharing was successfully implemented in this project by adding existing elements as links β†’ In your project on the Silverlight side, AddExisting item, select the * .resx file, check the "Add" button, expand it and select "Add as link".

0
source share

Adding as a link as a solution partially solves this problem, if I put the resource file (added as a link) in another folder that is not the one that created the template, you will get this error again, you will have to put all your resources in one and the same Web \ Resources folder if you plan to use the template. But what happens if you want to associate other services with their own resources (Ria services), it’s good if I try any method until today, and I still get this error:

0
source share

All Articles