Bugzilla – Bug 322382
[prj2make] Embedded Resources not found through -resource is specified
Last modified: 2007-09-15 21:24:23 UTC
---- Reported by jay.e.sternberg@intel.com 2006-10-16 18:49:49 MST ---- Description of Problem: Taking the default application created by Visual Studio 2003 and adding one button and one label, Mono builds fine and the resulting exe runs on windows. When I change the text of these controls to be retrieved from an embedded resource file, mscorlib.dll chokes with the below error. I have also done this from a dll with the same result. Compilation includes the - resource argument for this resource as created by Prj2Make. Steps to reproduce the problem: 1. Build default windows app in Visual Studio 2003 2. Add elements to the form (example is a button and a label) 3. Add an embedded resource to contain text for those elements 4. Add code to used that embedded resource (example below) 5. Compile (also below) and run Actual Results: An unhandled exception of type 'System.Resources.MissingManifestResourceException' occurred in mscorlib.dll Additional information: Could not find any resources appropriate for the specified culture (or the neutral culture) in the given assembly. Make sure "WindowsApplication1.Resource1.resources" was correctly embedded or linked into assembly "WindowsApplication1". baseName: WindowsApplication1.Resource1 locationInfo: <null> resource file name: WindowsApplication1.Resource1.resources assembly: WindowsApplication1, Version=1.0.2480.18386, Culture=neutral, PublicKeyToken=null Expected Results: Form to be displayed as occurs with MSVC version How often does this happen? Every time Additional Information: From Makefile: MCS=mcs MCSFLAGS=-debug --stacktrace SYSTEM_DLLS= -r:System.dll -r:System.Data.dll -r:System.Drawing.dll - r:System.Windows.Forms.dll -r:System.Xml.dll APP_EXE=$(DIR)\WindowsApplication1.exe APP_RES=-resource:WindowsApplication1 \Form1.resx,WindowsApplication1.Form1.resources \ -resource:WindowsApplication1 \Resource1.resx,WindowsApplication1.Resource1.resources $(MCS) $(MCSFLAGS) $(SYSTEM_DLLS) -target:winexe -out:$(APP_EXE) $(APP_RES) $(APP_SRC) From Form1.cs: System.Resources.ResourceManager embedded_resource = new System.Resources.ResourceManager("WindowsApplication1.Resource1", System.Reflection.Assembly.GetExecutingAssembly()); this.label1.Text = embedded_resource.GetString("Label"); // "label1"; this.button1.Text = embedded_resource.GetString("Button"); // "button1"; ---- Additional Comments From jay.e.sternberg@intel.com 2006-10-16 18:51:39 MST ---- Created an attachment (id=170660) winzip of MSVC Project with Mono Makefile ---- Additional Comments From jankit@novell.com 2006-11-20 14:08:58 MST ---- I tried generating the Makefile with prj2make (using mono from svn), and your sample code runs fine with it. Try using a recent version of mono. Imported an attachment (id=170660) Unknown bug field "cf_op_sys_details" encountered while moving bug <cf_op_sys_details>XP SP2</cf_op_sys_details> Unknown operating system unknown. Setting to default OS "Other".