[Mono-bugs] [Bug 78797][Nor] Changed - [2.0] web.config pages/controls config section ignored

bugzilla-daemon at bugzilla.ximian.com bugzilla-daemon at bugzilla.ximian.com
Fri Mar 2 00:49:21 EST 2007


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 mmorano at mikeandwan.us.

http://bugzilla.ximian.com/show_bug.cgi?id=78797

--- shadow/78797	2007-02-19 15:39:01.000000000 -0500
+++ shadow/78797.tmp.31874	2007-03-02 00:49:21.000000000 -0500
@@ -89,6 +89,63 @@
 
 This would probably be better, as it does not give an incorrect error
 message.
 
 Thanks,
 Mike
+
+------- Additional Comments From mmorano at mikeandwan.us  2007-03-02 00:49 -------
+Found another wrinkle to this one yesterday.  MS allows you to
+reference controls in this section that are defined in App_Code.  In
+this scenario, you can specify something like the following in web.config:
+
+<add tagPrefix="blah" namespace="blah.Web.UI" />
+
+In this case, on MS, this properly allows the controls defined in this
+namespace using a prefix of 'blah' to be used.  Currently in mono,
+this  is not allowed, as AspComponentFoundry.RegisterConfigControls()
+does not seem to perform a check for this condition.  Currently it
+tries to load an assembly of "" as it is not defined in the
+configuration element.
+
+I have been able to add in a hack to get around this, though am sure
+there must be a better way to account for this.  Here is an updated
+portion of the affected AspComponentFoundry.RegisterConfigControls
+method (starting around line 120):
+
+foreach (TagPrefixInfo tpi in controls) 
+{
+     if (!String.IsNullOrEmpty (tpi.TagName))
+     {
+         RegisterFoundry (tpi.TagPrefix, tpi.TagName, tpi.Source);
+     }
+     // ** BEGIN MODIFICATION **
+     else if (string.IsNullOrEmpty(tpi.Assembly))
+     {
+      	// get app code dll - (here the tagPrefix and namespace are
+provided)
+        // there must be a more reliable way to acheive this...
+       	IList tla = BuildManager.TopLevelAssemblies;
+                	
+       	if(tla != null && tla.Count > 0)
+       	{
+           RegisterFoundry (tpi.TagPrefix, (Assembly) tla[0], 
+                            tpi.Namespace);
+        }
+     }
+     // ** END MODIFICATION **
+     else if (!String.IsNullOrEmpty (tpi.Namespace))
+     {
+	RegisterFoundry (tpi.TagPrefix, 
+              GetAssemblyByName (assemblyCache, tpi.Assembly), 
+              tpi.Namespace);
+     }
+}
+
+I am still working through how to get these controls to fully work
+properly on the page, but at least this seems to move the process
+further along.  I hope that this might provide some insight to help
+someone with better understanding of how these pieces fit together to
+find a good solution to this...
+
+Thanks again,
+Mike


More information about the mono-bugs mailing list