Please do not reply to this email- if you want to comment on the bug, go to the URL shown below and enter your comments there.
Changed by [EMAIL PROTECTED] http://bugzilla.ximian.com/show_bug.cgi?id=79182 --- shadow/79182 2006-09-16 05:48:52.000000000 -0400 +++ shadow/79182.tmp.4396 2006-10-07 09:13:35.000000000 -0400 @@ -11,13 +11,13 @@ AssignedTo: [EMAIL PROTECTED] ReportedBy: [EMAIL PROTECTED] QAContact: [EMAIL PROTECTED] TargetMilestone: 1_2 URL: Cc: -Summary: Localizable Forms -> ResourceSet is closed. +Summary: [Patch] Localizable Forms -> ResourceSet is closed. I'm using the Linux Installer 1.1.16.1, following error occurs when trying to start a localizable MWF application: [EMAIL PROTECTED]:~$ mono ResourceTest.exe @@ -85,6 +85,72 @@ [...] ------------------ So removing of "rset.Close ();" from System.Resources/ResourceSet.ApplyResources() solve the problem with the "System.InvalidOperationException: ResourceSet is closed." exception. + +------- Additional Comments From [EMAIL PROTECTED] 2006-10-07 09:13 ------- +The problem here is, as Daniel wrote, that +ComponentResourceManager.ApplyResources() closes the ResourceSet, +which actually means that the ResourceSet gets disposed. + +Calling ApplyResources() multiple times returned a disposed +ResourceSet in ResourceManager.InternalGetResourceSet and that caused +the exception. + +So, here is a patch that fixes the problem: + +Index: System/System.ComponentModel/ComponentResourceManager.cs +=================================================================== +--- System/System.ComponentModel/ComponentResourceManager.cs (Revision +66385) ++++ System/System.ComponentModel/ComponentResourceManager.cs +(Arbeitskopie) +@@ -71,7 +71,6 @@ + pi.SetValue (value, Convert.ChangeType (di.Value, +pi.PropertyType), null); + } + } +- rset.Close (); + } + } + } +Index: corlib/System.Resources/ResourceSet.cs +=================================================================== +--- corlib/System.Resources/ResourceSet.cs (Revision 66385) ++++ corlib/System.Resources/ResourceSet.cs (Arbeitskopie) +@@ -48,6 +48,7 @@ + + protected IResourceReader Reader; + protected Hashtable Table; ++ internal bool isDisposed = false; + + // Constructors + protected ResourceSet () {} +@@ -102,6 +103,8 @@ + + Reader = null; + Table = null; ++ ++ isDisposed = true; + } + + public virtual Type GetDefaultReader () +Index: corlib/System.Resources/ResourceManager.cs +=================================================================== +--- corlib/System.Resources/ResourceManager.cs (Revision 66385) ++++ corlib/System.Resources/ResourceManager.cs (Arbeitskopie) +@@ -290,8 +290,11 @@ + } + /* if we already have this resource set, return it */ + set=(ResourceSet)ResourceSets[culture]; +- if(set!=null) { ++ if(set!=null && !set.isDisposed) { + return(set); ++ } else if (set!=null && set.isDisposed) { ++ ResourceSets.Remove (set); ++ set = null; + } + + if(MainAssembly != null) { + _______________________________________________ mono-bugs maillist - [email protected] http://lists.ximian.com/mailman/listinfo/mono-bugs
