Avatar of edemcs
edemcs
Flag for United States of America

asked on 

Cannot find Resource files with the resource manager for a compiled DLL

Scenario:
Using Visual Studio 2005 VB.NET

1) I have a Class Library that contains only resource files.  Right now, two.  WebResource.resx and WebResource.es-MX.resx.  Both files are set to embedded when compiled.

2) I reference the class library of resources in my Web Site.  Doing so adds a subfolder es-MX with (ClassLibrayName.resources.dll) and within the bin directory ClassLibraryName.dll

I believe this is correct.

In my codebehind is the following code:
            Dim ci As New System.Globalization.CultureInfo("es-MX")
            CurrentThread.CurrentUICulture = ci
            Dim translatedValue As String
            Dim resmgr As New ResourceManager("ClassLibraryName.WebResource", Assembly.GetExecutingAssembly())
            translatedValue = resmgr.GetString("btnTest", ci)

I get the following exception when I call the GetString method:

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

I've been researching this error and tried many things...PLEASE HELP!!!!!!

.NET Programming

Avatar of undefined
Last Comment
edemcs

8/22/2022 - Mon