'System.Resources.MissingManifestResourceException'

J

Jesse

Hi together,

I've a problem with compiling an application with a build-Script and run it
after.

Several resource-files I compile with resgen.exe and put the files into a
folders of the language. (en\*.resources, en-US\*.resources ...)
With al.exe I generating several dlls with the format
applicationname.resource.dll (in every language-folders one dll)

I compile the C#-sources with csc and several options and include with
/resource:-Option the dll of the neutral language. There is no error while
compiling.

When I start the application.exe, the Exception above will be shown.

A not handled exception of type
'System.Resources.MissingManifestResourceException' has occured in
mscorlib.dll.

For this culture (or the neutrale culture) in this assembly no resources has
been found. Make sure that 'SplashForm.resources' will be embedded accurate
in the assembly 'applicationname'.

What's wrong on building the application, do you have an idea ?

jesse
 
B

Buddy

You probably are loading the resource filename incorrectly. For example your
resource file might be called Test.MyResource.File.resources and you
probably are not passing in the correct resource name
'Test.MyResource.File'.

Hope this helps,
 
J

Jesse

Thanks Buddy, but it doesn't really works.

Per resgen.exe I get several .resources-files which I compile in a DLL with
the /embed:-option

parameters are %2 - applicationName (Test), %3 - culture (en, en-US ...)

@echo /t:lib > embed.txt
@for %%f in (*.resources) do @echo /embed:%%f,%2.%%f >> embed.txt
@echo /culture:%3 >> embed.txt
@echo /out:%2.resources.dll >> embed.txt

Ther content of the file embed.txt semms like this:

/t:lib
/embed:AboutForm.en.resources,Test.AboutForm.en.resources
/embed:AdministrationForm.en.resources,Test.AdministrationForm.en.resources
/embed:DiagramOverviewForm.en.resources,Test.DiagramOverviewForm.en.resource
s
/embed:FOUpdateForm.en.resources,Test.FOUpdateForm.en.resources
/culture:en
/out:Test.resources.dll

al @embed.txt

The result: In each culture-directory I got a file Test.resources.dll

After this I compile the sources with csc /resource:Test.resources.dll the
neutral culture in the winexe Text.exe. The culture-dlls I copied in the
applicationfolder as the follow structure.

applicationfolder\en\Test.resources.dll
applicationfolder\en-US\Test.resources.dll

Is there a mistake so far ?


thanks jesse
 
J

Jesse

Hi,

here's the solution.
You've to compile the resources-files of the neutral language with the
/resource:-option into the assembly, but you have also to write in this
option the namespace or package-name of the resources, then you'll have
access to this resoucres from your application.

thanks jesse
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top