4
votes

Here is the code i'm struggling with:

System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(EditorPane));
this.editorControl = new EditorControl();
resources.ApplyResources(this.editorControl, "editorControl", CultureInfo.CurrentUICulture);

when the code is executing, it's throw a 'System.Resources.MissingManifestResourceException' the all error message is just bellow.

An exception of type 'System.Resources.MissingManifestResourceException' occurred in mscorlib.dll but was not handled in user code

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

1
Are you working on a Windows Forms Application? I had the same problem with an internal class definition. Defining an internal class in the same namespace together with the Form class caused this exception.Hermann Schachner

1 Answers

3
votes

For me, the problem was not any internal class definition. Instead, the problem source was in the project file, which took me quite some time to find out.

This is what I found in the project file:

<EmbeddedResource Include="Main.resx" />

And this is what it has to be:

<EmbeddedResource Include="Main.resx">
  <DependentUpon>Main.pas</DependentUpon>
</EmbeddedResource>

If this dependency is not listed there (and I have to underline, I did not remove it myself - it was done at some stage by MS Visual Studio), the necessary resource file is not included properly in the compilation routine.

I hope this helps (and saves others some headache)!