views:

10

answers:

0

We are working on a project with many different developers and do not want to make a too big mess of using the resources, so therefore we want to use unified explicit syntax:

<%$ Resources:[filename prefix,]resource-key %>

We also want to specify a custom build tool: PublicResXFileCodeGenerator (or any other if it would suit more) to allow strongly-typed access form code-behind.

But! This will fail at runtime if build type for resx is set to "Content" when accessing from code-behind (.cs) with following message:

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

When the bulid type is set to "Embeded resource", the problem is that markup explicit syntax is not working well (it's ok, if we deploy the resx file manually to the server). Looking at .dll with Reflector I can see resources are embeded ok, but looks like they can't be found in assembly. Tried everything with full namespaces etc - no solution. One way it would be to call them directly from compiled dll:

<%= TheWebApplication.App_GlobalResources.TheWebApplicationGlobalResource.keyName %>

but this somehow breaks our wish of unified syntax.

Any clue?