473,323 Members | 1,560 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,323 software developers and data experts.

Problen with MissingManifestResourceException

Hallo,

I have a problem with a MissingManifestResourceException. I'm trying by days
without finding any solution.
Shortly the context:

I have a .Net application (APPL_1), which does the following:
- purpose: generate resources file in Online dialog for a VS 2005 project
- gets as parameter the base-directory of another Application. (Here: a VS
2005 Project APPL_2.exe)
- creates localized resource objects (in dialog with user) and stores them
in .resources files.
example: APPL_2.resources, APPL_2.de.resources,
APPL_2.de-DE.resources , ...
- creates the satellite assemblies using AL-utility (via Process) using the
created resources files
APPL_2.dll (for de), APPL_2.dll (for de-DE) and stores
them as
APPL_2\bin\debug\de\APPL_2.dll
APPL_2\bin\debug\de-DE\APPL_2.dll
- copies the neutral resources file: to directory
APPL_2\Resources\APPL_2.resources to be embedded in the APPL_2.exe

Working with VS 2005 (Project APPL_2)
- The APPL_2\Resources\APPL_2.resources is added to the project
- the property Embedded Resource is set
- The namespace of all .cs files is the same (company.Net.APPL_2)
- the default namespace in properties of project is the same
(company.Net.APPL_2)
- after building the project, the resource file the obj\debug contains
company.Net.APPL_2.APPL_2.resources (as exspected)

now I exspect, that this resources file after building is embedded in the
main assembly representing the neutral culture.

Running:
- CurrentUICulture is not chganged (de-DE)
- A ResourceManager is created : rm = new ResourceManager("APPL_2",
Assembly.LoadFrom("APPL_2.exe"));
- the access: object x = rm.GetObject("anykey")

- if the resource with that key is available in any satellite, it is
accessed without errors
- if not, I get the MissingManifestResourceException, regardless of the
existence of that key in the neutral resources.

I don't find a way, to get a successful access on the neutral resources.

- if rm is created with : .... Assembly.LoadFrom("APPL_2.exe"), no success
- if rm is created with : .... Assembly.GetExecutingAssembly), no success

I appreciate any help, thankyou
Michael
Feb 28 '07 #1
3 4942
Hi Michael,

I am sorry that I may not understand your scenario exactly. Based on my
understanding, you have an application called APPL_1 which is used to
generate resources file for another application APPL_2. The problem is that
you couldn't access the data correctly in the neutral resources in the
APPL_2. If I'm off base, please feel free to let me know.

For application internationalization, we usually create culture-specific
resource files and then bundle them into a satellite assembly per culture.
The satellite assembly should have the name of
'projectnamespace.projectname.resources.dll'.

As for the culture-neutral resource, it should be bundled into the main
assembly and we usually do this when compiling the project. For example,
VS05 uses the following command to compile the project with the /resource
switch:

C:\WINNT\Microsoft.NET\Framework\v2.0.50727\Csc.ex e /noconfig
/nowarn:1701,1702 /errorreport:prompt /warn:4 /define:DEBUG;TRACE
/reference:C:\WINNT\Microsoft.NET\Framework\v2.0.50 727\System.Data.dll
/reference:C:\WINNT\Microsoft.NET\Framework\v2.0.50 727\System.Deployment.dll
/reference:C:\WINNT\Microsoft.NET\Framework\v2.0.50 727\System.dll
/reference:C:\WINNT\Microsoft.NET\Framework\v2.0.50 727\System.Drawing.dll
/reference:C:\WINNT\Microsoft.NET\Framework\v2.0.50 727\System.Windows.Forms.
dll /reference:C:\WINNT\Microsoft.NET\Framework\v2.0.50 727\System.Xml.dll
/debug+ /debug:full /optimize- /out:obj\Debug\ResourceTest.exe
/resource:obj\Debug\ResourceTest.Form1.resources
/resource:obj\Debug\ResourceTest.Properties.Resourc es.resources
/target:winexe Form1.cs Form1.Designer.cs Program.cs
Properties\AssemblyInfo.cs Properties\Resources.Designer.cs
Properties\Settings.Designer.cs

It seems that after building the project APPL_2, the culture-neutral
resource file is not bundled into the main assembly in your scenario. In
addition, we couldn't use the Al.exe command to bundle the culture-neutral
resource into the main assembly. When we do this, the previous meta data in
the main assembly will be flushed.

If the problem is still not resolved, could you please send me a sample
project that could just reproduce the problem? To get my actual email
address, remove 'online' from my displayed email-address.

Sincerely,
Linda Liu
Microsoft Online Community Support

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.aspx#notif
ications.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscripti...t/default.aspx.
==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.

Mar 1 '07 #2
Hi Michael,

Thank you for your detailed explanation. I understand your problem now.

Even if you place the culture-neutral resource under the Properties folder
of the APP_2 project, I don't think the resource will be bundled into the
main assembly of the APPL_2 when you build it.

FYI, you may use the .NET utility 'IL DASM' to check if a resource is
bundled properly into an assembly. To access this utility, type the command
'ildasm' in the Visual Studio 2005 command prompt. Open the main assembly
of the APPL_2 in the tool 'IL DASM' and double click the 'MANIFEST' node.
You should be able to see a .mresource token for the culture-neutral
resource in the 'MANIFEST' window, similar to the following, if the
resource is successfully bundled.

.mresource public APPL_2.resources
{
// Offset: 0x00000000 Length: 0x000000B4
}

To embed a resource into an assembly properly, I suggest that you write the
the compilation command by yourself and specify the culture-neutral
resource with the 'resource' switch in the compilation command to build the
APPL_2 project.

The following is the compilation command samples.

VB.NET project compilation command sample:

D:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Vbc. exe /noconfig
/imports:Microsoft.VisualBasic,System,System.Collec tions,System.Collections.
Generic,System.Data,System.Drawing,System.Diagnost ics,System.Windows.Forms
/nowarn:42016,41999,42017,42018,42019,42032,42036,4 2020,42021,42022
/rootnamespace:vbproject /doc:obj\Debug\vbproject.xml
/define:"CONFIG=\"Debug\",DEBUG=-1,TRACE=-1,_MyType=\"WindowsForms\",PLATFOR
M=\"AnyCPU\""
/reference:D:\WINDOWS\Microsoft.NET\Framework\v2.0. 50727\System.Data.dll,D:\
WINDOWS\Microsoft.NET\Framework\v2.0.50727\System. Deployment.dll,D:\WINDOWS\
Microsoft.NET\Framework\v2.0.50727\System.dll,D:\W INDOWS\Microsoft.NET\Frame
work\v2.0.50727\System.Drawing.dll,D:\WINDOWS\Micr osoft.NET\Framework\v2.0.5
0727\System.Windows.Forms.dll,D:\WINDOWS\Microsoft .NET\Framework\v2.0.50727\
System.Xml.dll /main:vbproject.My.MyApplication /debug+ /debug:full
/out:obj\Debug\vbproject.exe
/resource:obj\Debug\vbproject.Resources.resources /target:winexe Form1.vb
Form1.Designer.vb "My Project\AssemblyInfo.vb" "My
Project\Application.Designer.vb" "My Project\Resources.Designer.vb" "My
Project\Settings.Designer.vb"

C# project compilation command sample.

D:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Csc. exe /noconfig
/nowarn:1701,1702 /errorreport:prompt /warn:4 /define:DEBUG;TRACE
/reference:D:\WINDOWS\Microsoft.NET\Framework\v2.0. 50727\System.Data.dll
/reference:D:\WINDOWS\Microsoft.NET\Framework\v2.0. 50727\System.Deployment.d
ll /reference:D:\WINDOWS\Microsoft.NET\Framework\v2.0. 50727\System.dll
/reference:D:\WINDOWS\Microsoft.NET\Framework\v2.0. 50727\System.Drawing.dll
/reference:D:\WINDOWS\Microsoft.NET\Framework\v2.0. 50727\System.Windows.Form
s.dll
/reference:D:\WINDOWS\Microsoft.NET\Framework\v2.0. 50727\System.Xml.dll
/debug+ /debug:full /optimize- /out:obj\Debug\TopMostWithoutFocusForm.exe
/resource:obj\Debug\TopMostWithoutFocusForm.Form1.r esources
/resource:obj\Debug\TopMostWithoutFocusForm.Form2.r esources
/resource:obj\Debug\TopMostWithoutFocusForm.Propert ies.Resources.resources
/target:winexe Form1.cs Form1.Designer.cs Form2.cs Form2.Designer.cs
Program.cs Properties\AssemblyInfo.cs Properties\Resources.Designer.cs
Properties\Settings.Designer.cs

Hope this helps.
If you have any question, please feel free to let me know.
Sincerely,
Linda Liu
Microsoft Online Community Support

Mar 5 '07 #3
Hi Michael,

Thank you for your prompt response.

Firstly, I notice that the manifest of the Ebhab.dll is same as that of the
RESMANAGER.EXE, which shouldn't be the same. Did you make a mistake?

Secondly, do you mean that the culture-neutral resource is
Ebhab.Net.Windows.Forms.Resources.Ebhab.resources? From the manifest you
provided, it seems that this resource is bundled in the Ebhab.dll assembly.
So you should be able to access this resource within the Ebhab.dll assembly
using the following statement:

ResourceManager rm = new
ResourceManager(typeof(Ebhab.Net.Windows.Forms.Res ources.Ebhab));
object obj = rm.GetObject(anykey);

Or you may also access this resource in the RESMANAGER.exe using the
following statement:

Assembly ass = Assembly.LoadFile(Application.StartupPath + "\\Ebhab.dll");
ResourceManager rm = new ResourceManager(anykey,ass);

Hope this helps.
Sincerely,
Linda Liu
Microsoft Online Community Support

Mar 7 '07 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: lobrys | last post by:
hi here is my problem I have sometimes the following error MissingManifestResourceException in my project during execution... I dont know how to resolve it. I saw that if you have several...
0
by: Mike | last post by:
Hi, I have a problem using ResourceManager GetString. The underlying resource is a simple text lookup using the resx data contents. When I specify a resource manager instance from an...
0
by: ShivaPrem | last post by:
Hi! I have tutorial, but I still can't get the full picture of resources. I've got the following code ResourceManager rm =new ResourceManager("myresources.en-us",...
3
by: Jesse | last post by:
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...
0
by: Ian | last post by:
Hi there, Well I managed to compile by satellite dll's but still can't get it to work. It keeps throwing the following error. (see below) My code is ok I think but there must be something...
1
by: Carlos | last post by:
Hi all, I just got an unhandled exception of type MissingManifestResourceException but do not know what it means. I declare a class before the main form, and within the namespace. can...
1
by: Rick Palmer | last post by:
Can someone explain what the hell a MissingManifestResourceException is and why I'm getting one every time I add a particular picture to my form? I've even went as far as using a button instead of...
0
by: Rob Dob | last post by:
Hi, I have a VS2003 C# asp.net project that has been converted into a VS2005 project. Everything seemed to work well until I make a modification to anything within the Component Designer...
3
by: prigupta2 | last post by:
Private Sub EnlargeDrawing(ByVal DrawControl As System.Drawing.Graphics) DrawControl.Height = VB6.TwipsToPixelsY(4980) DrawControl.Width = VB6.TwipsToPixelsX(4980) Error 1 'Height' is not a member...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.