locked
.resx file issue post Update2 RRS feed

  • Question

  • Hi all,

    Pre Update 2, my solution used a .resx file, based in the Common/Resources folder, which basically just held a few regex definitions for both client and server code to validate against.

    I notice that my common folder still exists post Update 2 although obviously its not used anymore. However that's the only place ( post update ) that the .resx file exists. In other words, the update process has not 'translated' it to build within the new project structure.

    So what I tried to do was redefine it in 'server/shared' and then add the .resx and its generated designer.cs' file as a link in the client/usercode/shared folder. The .resx is set to 'EmbeddedResource' and the solution builds with no problems.

    However at runtime when code attempts to perform an operation by calling one of the regex strings I have in the .resx, I get the following error:

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

    I've struggled with this for hours now, does anyone have any pointers?

    Thanks in advance


    Ian Mac

    Tuesday, April 16, 2013 1:06 PM

Answers

  • Hi Ian,

    It's been a while since I worked with resource files, but if I remember correctly, linking .resx file can be tricky because resource name may depend on the relative path in the project.

    Instead of linking resx files, it may work better if you create a common Silverlight Class Library that contains the resx, then reference this common library from both Client and Server project. This works for me:

    1. On your solution, right click, Add New Project.
    2. Pick Visual Basic or Visual C# | Silverlight Class Library, Silverlight 5.
    3. On your LightSwitch project, switch to File View.
    4. Add a reference to the project in step 2 to both Client and Server project.

    Hope this helps. Best regards,
    Huy Nguyen


    Friday, April 19, 2013 9:45 PM