[Mono-dev] Resource Issue

Jonathan Pobst monkey at jpobst.com
Fri Feb 29 18:45:08 EST 2008


I hate to just dump my project here, but I am having trouble making a 
standalone test case out of this.  It causes an exception when I compile 
in MonoDevelop and try to run on opensuse 10.3.

For my pet project XmppApplication:
svn checkout http://xmppapplication.googlecode.com/svn/trunk/ 
xmppapplication

Compile on .net, runs on .net correctly.
Compile on .net, runs on opensuse 10.3 mono 1.9 correctly.
Compile in MD, fails on opensuse 10.3 mono 1.9 runtime with exception below.
Compile in MD, runs on .net correctly.
Compile in MD, runs on winmono 1.9 correctly.

Exception:
Unhandled Exception: System.TypeInitializationException: An exception 
was thrown by the type initializer for XmppApplication.Base.XmppImages 
---> System.Reflection.TargetInvocationException: Exception has been 
thrown by the target of an invocation. ---> System.ArgumentException: A 
null reference or invalid value was found [GDI+ status: InvalidParameter]
   at System.Drawing.GDIPlus.CheckStatus (Status status) [0x0009d] in 
/tmp/monobuild/build/BUILD/mono-1.9/mcs/class/System.Drawing/System.Drawing/gdipFunctions.cs:219 

   at System.Drawing.Image.InitFromStream (System.IO.Stream stream) 
[0x000be] in 
/tmp/monobuild/build/BUILD/mono-1.9/mcs/class/System.Drawing/System.Drawing/Image.cs:298 

   at System.Drawing.Image..ctor 
(System.Runtime.Serialization.SerializationInfo info, StreamingContext 
context) [0x00055] in 
/tmp/monobuild/build/BUILD/mono-1.9/mcs/class/System.Drawing/System.Drawing/Image.cs:74 

   at System.Drawing.Bitmap..ctor 
(System.Runtime.Serialization.SerializationInfo info, StreamingContext 
context) [0x00000] in 
/tmp/monobuild/build/BUILD/mono-1.9/mcs/class/System.Drawing/System.Drawing/Bitmap.cs:148 

   at (wrapper managed-to-native) 
System.Reflection.MonoCMethod:InternalInvoke (object,object[])
   at System.Reflection.MonoCMethod.Invoke (System.Object obj, 
BindingFlags invokeAttr, System.Reflection.Binder binder, 
System.Object[] parameters, System.Globalization.CultureInfo culture) 
[0x0003f] in 
/tmp/monobuild/build/BUILD/mono-1.9/mcs/class/corlib/System.Reflection/MonoMethod.cs:404 
--- End of inner exception stack trace ---

   at System.Reflection.MonoCMethod.Invoke (System.Object obj, 
BindingFlags invokeAttr, System.Reflection.Binder binder, 
System.Object[] parameters, System.Globalization.CultureInfo culture) 
[0x00064] in 
/tmp/monobuild/build/BUILD/mono-1.9/mcs/class/corlib/System.Reflection/MonoMethod.cs:414 

   at System.Reflection.MethodBase.Invoke (System.Object obj, 
System.Object[] parameters) [0x00000] in 
/tmp/monobuild/build/BUILD/mono-1.9/mcs/class/corlib/System.Reflection/MethodBase.cs:90 

   at System.Runtime.Serialization.ObjectRecord.LoadData 
(System.Runtime.Serialization.ObjectManager manager, ISurrogateSelector 
selector, StreamingContext context) [0x000d7] in 
/tmp/monobuild/build/BUILD/mono-1.9/mcs/class/corlib/System.Runtime.Serialization/ObjectManager.cs:578 

   at System.Runtime.Serialization.ObjectManager.DoFixups () [0x00069] 
in 
/tmp/monobuild/build/BUILD/mono-1.9/mcs/class/corlib/System.Runtime.Serialization/ObjectManager.cs:84 

   at 
System.Runtime.Serialization.Formatters.Binary.ObjectReader.ReadNextObject 
(System.IO.BinaryReader reader) [0x0000f] in 
/tmp/monobuild/build/BUILD/mono-1.9/mcs/class/corlib/System.Runtime.Serialization.Formatters.Binary/ObjectReader.cs:115 

   at 
System.Runtime.Serialization.Formatters.Binary.ObjectReader.ReadObjectGraph 
(System.IO.BinaryReader reader, Boolean readHeaders, System.Object& 
result, System.Runtime.Remoting.Messaging.Header[]& headers) [0x00041] 
in 
/tmp/monobuild/build/BUILD/mono-1.9/mcs/class/corlib/System.Runtime.Serialization.Formatters.Binary/ObjectReader.cs:105 

   at 
System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.NoCheckDeserialize 
(System.IO.Stream serializationStream, 
System.Runtime.Remoting.Messaging.HeaderHandler handler) [0x00076] in 
/tmp/monobuild/build/BUILD/mono-1.9/mcs/class/corlib/System.Runtime.Serialization.Formatters.Binary/BinaryFormatter.cs:177 

   at 
System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Deserialize 
(System.IO.Stream serializationStream) [0x00000] in 
/tmp/monobuild/build/BUILD/mono-1.9/mcs/class/corlib/System.Runtime.Serialization.Formatters.Binary/BinaryFormatter.cs:134 

   at System.Resources.ResourceReader.ReadNonPredefinedValue 
(System.Type exp_type) [0x00000] in 
/tmp/monobuild/build/BUILD/mono-1.9/mcs/class/corlib/System.Resources/ResourceReader.cs:351 

   at System.Resources.ResourceReader.ReadValueVer2 (Int32 type_index) 
[0x001f9] in 
/tmp/monobuild/build/BUILD/mono-1.9/mcs/class/corlib/System.Resources/ResourceReader.cs:310 

   at System.Resources.ResourceReader.ResourceValue (Int32 index) 
[0x00092] in 
/tmp/monobuild/build/BUILD/mono-1.9/mcs/class/corlib/System.Resources/ResourceReader.cs:394 

   at System.Resources.ResourceReader+ResourceEnumerator.get_Value () 
[0x00032] in 
/tmp/monobuild/build/BUILD/mono-1.9/mcs/class/corlib/System.Resources/ResourceReader.cs:603 

   at System.Resources.ResourceSet.ReadResources () [0x00043] in 
/tmp/monobuild/build/BUILD/mono-1.9/mcs/class/corlib/System.Resources/ResourceSet.cs:208 

   at System.Resources.ResourceSet.GetObject (System.String name, 
Boolean ignoreCase) [0x00032] in 
/tmp/monobuild/build/BUILD/mono-1.9/mcs/class/corlib/System.Resources/ResourceSet.cs:163 

   at System.Resources.ResourceManager.GetObject (System.String name, 
System.Globalization.CultureInfo culture) [0x00038] in 
/tmp/monobuild/build/BUILD/mono-1.9/mcs/class/corlib/System.Resources/ResourceManager.cs:186 

   at XmppApplication.Base.Properties.Resources.get_DefaultAvatar () 
[0x00000] in 
/home/jpobst/Desktop/XmppApplication/XmppApplication.Base/Properties/Resources.Designer.cs:79 

   at XmppApplication.Base.XmppImages..cctor () [0x00000] --- End of 
inner exception stack trace ---

   at (wrapper remoting-invoke-with-check) XmppApplication.MainForm:.ctor ()
   at XmppApplication.Program.Main () [0x0000b] in 
/home/jpobst/Desktop/XmppApplication/XmppApplication/Program.cs:44


Anyone have a clue as to what is wrong or how I can make a simple test 
case?  Every attempt I have made to make a simple case from scratch 
works just fine in MD.

Thanks!
Jonathan


More information about the Mono-devel-list mailing list