0
votes

I am trying to acquire resource by resourcefilename and key this way:

ResourceManager rm = new ResourceManager("B2B.Portal.Resources.Views." + viewType, Assembly.GetExecutingAssembly());
var res = rm.GetResourceSet(CultureInfo.CurrentCulture, true, true);

I am getting this error:

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

How can I make it stop adding '.resources' suffix or maybe this is not the issue?

Edit: forgot to mention: these are manually added localization resources

1
That suffix is always present, generated by Resgen.exe. You guessed at the name incorrectly, a very common problem and the core reason that Microsoft added the Resource Designer. We can't guess at it either, use ildasm.exe and look at the manifest. You'll see the proper name in one of the .resource directives. With non-zero odds that you don't find it at all if you "manually" added resources. Use standard .NET localization techniques, you'll have good odds for a lot more trouble when your localization services gets it wrong as well because it is non-standard. - Hans Passant

1 Answers

0
votes

Maybe it is not exactly answer to my question but it is an alternative solution:

Type.GetType("B2B.Portal.Resources.View." + viewType + "." + viewType).GetProperty(col.Name).GetValue(null, null).ToString()