Resources not found when using assembly from another application

Status
Not open for further replies.
L

Lieven Cardoen

Guest
I have an assembly with an embedded resource file (resx). When testing my code with a Windows Form project in the same solution, loading the resource works fine. However, when using the assembly from another application, it doesn't find the resource.

The code I'm using to load the resource is (inside the StringHelper class)

const string BaseName = "Mips.Win.SupportDialogs.Resources.RibbonCustomization";
this.resourceManager = new ResourceManager(BaseName, typeof(StringHelper).Assembly);


In both the applications this code doesn't raise an error. However, when getting a string from the resourceManager, an error is raised when using the assembly from another application. When inspecting the resourceManager with the Debugger, I also see that in the Windows Forms project, the resource has actually been loaded (resourceSets is 1). In the seperate application, it hasn't been loaded (resourceSets is 0).


System.Resources.MissingManifestResourceException: Could not find any resources appropriate for the specified culture or the neutral culture. Make sure "Mips.Win.SupportDialogs.Resources.RibbonCustomization.resources" was correctly embedded or linked into assembly "Mips.Win.SupportDialogs" at compile time, or that all the satellite assemblies required are loadable and fully signed.

The properties from the resource itself are set to Embedded Resource.

What's the best way to debug this? Apparently, creating the instance of the ResourceManager doesn't raise an error in case where it doesn't find the resource... It only does when later on a GetString is executed on the resourceManager. If the resource file is embedded into the assembly, I guess it shouldn't matter where the assembly is loaded from...

The 'other' application is a Progress application which has the ability to load .NET assemblies.

UPDATE

When looking with Process Monitor, I have the impression that a Mips.Win.SupportDialogs.resources.dll is trying to be loaded. + It searches for this assembly in a subfolder nl-BE (my culture) of the folder where the assemblies reside. But there's no Mips.Win.SupportDialogs.resources.dll file, only a Mips.Win.SupportDialogs.dll. And there's no nl-BE folder. Maybe this is default behavior (from Progress or .NET) to try and load resources before loading the assembly itself (so it could not be related to my problem).

The actual excepetion I'm getting is:


First-chance exception at 0x767cc41f in prowin32.exe: Microsoft C++ exception: EEFileLoadException at memory location 0x003e61ac.

If there is a handler for this exception, the program may be safely continued.

Continue reading...
 
Status
Not open for further replies.
Top