I was unable to access the resource file until I moved the .resx file to my own project and named this project from my main one. I also had to create a dummy class in this project so that it compiles into a DLL file.
The code for accessing the resource file is actually located in the generated Resource.resx.vb file.
I was able to access the resource file using the following code.
'Name of Class Library where I moved the resx file Dim classLibraryName As String = "ResourceProj" 'Name of Resource File without the .resx suffix Dim resourceFileName As String = "Mappings" 'Finding the assembly of the resx file, ResourceProjClass is a dummy class I created so that the dll would build. Dim myAssembly As Assembly = GetType(ResourceProj.ResourceProjClass).Assembly Dim rm As Resources.ResourceManager = Nothing rm = New Resources.ResourceManager(classLibraryName & "." & resourceFileName, GetType(myAssembly) Return rm.GetString(lookUpKey)
source share