[Mono-bugs] [Bug 519161] New: C# compiler throws compile exception when doing some reflections

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Fri Jul 3 07:43:38 EDT 2009


http://bugzilla.novell.com/show_bug.cgi?id=519161


           Summary: C# compiler throws compile exception when doing some
                    reflections
    Classification: Mono
           Product: Mono: Compilers
           Version: 2.4.x
          Platform: x86
        OS/Version: openSUSE 11.1
            Status: NEW
          Severity: Critical
          Priority: P5 - None
         Component: C#
        AssignedTo: mono-bugs at lists.ximian.com
        ReportedBy: jwezel at compumaster.de
         QAContact: mono-bugs at lists.ximian.com
          Found By: ---


User-Agent:       Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0; WOW64;
Trident/4.0; SLCC1; .NET CLR 2.0.50727; .NET CLR 1.1.4322; .NET CLR 3.5.21022;
NET CLR 3.5.30729; InfoPath.2; .NET CLR 3.0.30729)

I've got compiler errors when trying to access my test website and if I've put
a file "cammWM.dll" or "camm.WebControls.dll" into my bin directory.


C# fails if I use a control on my page provided by that cammWM.dll. Here the
message from my hello_world_csharp.aspx:

Server Error in '/' Application

--------------------------------------------------------------------------------

The classes in the module cannot be loaded.
Description: HTTP 500. Error processing request.

Stack Trace: 

System.Reflection.ReflectionTypeLoadException: The classes in the module cannot
be loaded.
  at (wrapper managed-to-native) System.Reflection.Assembly:GetTypes (bool)
  at System.Reflection.Assembly.GetTypes () [0x00000]
  at System.Web.UI.TemplateParser.FindNamespaceInAssembly
(System.Reflection.Assembly asm, System.String namesp) [0x00000]
  at System.Web.UI.TemplateParser.AddAssemblyForNamespace (System.String
namesp) [0x00000]
  at System.Web.UI.TemplateParser.AddImport (System.String namesp) [0x00000]
  at System.Web.UI.TemplateParser.RegisterNamespace (System.String tagPrefix,
System.String ns, System.String assembly) [0x00000]
  at System.Web.UI.TemplateControlParser.AddDirective (System.String directive,
System.Collections.Hashtable atts) [0x00000]
  at System.Web.Compilation.AspGenerator.TagParsed (ILocation location, TagType
tagtype, System.String tagid, System.Web.Compilation.TagAttributes attributes)
[0x00000]
  at System.Web.Compilation.AspParser.OnTagParsed (TagType tagtype,
System.String id, System.Web.Compilation.TagAttributes attributes) [0x00000]
  at System.Web.Compilation.AspParser.Parse () [0x00000]
  at System.Web.Compilation.AspGenerator.Parse (System.IO.TextReader reader,
System.String filename, Boolean doInitParser) [0x00000]
  at System.Web.Compilation.GenericBuildProvider`1[TParser].Parse () [0x00000]
  at
System.Web.Compilation.GenericBuildProvider`1[TParser].get_CodeCompilerType ()
[0x00000]
  at System.Web.Compilation.BuildManager.GetCodeDomProviderType
(System.Web.Compilation.BuildProvider provider) [0x00000]
  at System.Web.Compilation.BuildManager+BuildItem..ctor
(System.Web.Compilation.BuildProvider provider) [0x00000]
  at System.Web.Compilation.BuildManager.LoadBuildProviders
(System.Web.VirtualPath virtualPath, System.String virtualDir,
System.Collections.Generic.Dictionary`2 vpCache,
System.Web.Compilation.BuildKind& kind, System.String& assemblyBaseName)
[0x00000]  


  at System.Web.Compilation.BuildManager.BuildAssembly (System.Web.VirtualPath
virtualPath) [0x00000]
  at System.Web.Compilation.BuildManager.GetCompiledType (System.String
virtualPath) [0x00000]
  at System.Web.Compilation.AspComponentFoundry+TagNameFoundry.LoadType ()
[0x00000]
  at System.Web.Compilation.AspComponentFoundry+TagNameFoundry.GetType
(System.String componentName, System.String& source, System.String& ns)
[0x00000]
  at System.Web.Compilation.AspComponentFoundry.CreateComponent
(System.Web.Compilation.Foundry foundry, System.String tagName, System.String
prefix, System.String tag) [0x00000]
  at System.Web.Compilation.AspComponentFoundry.GetComponent (System.String
tagName) [0x00000]
  at System.Web.UI.RootBuilder.GetChildControlType (System.String tagName,
IDictionary attribs) [0x00000]
  at System.Web.UI.ControlBuilder.CreateSubBuilder (System.String tagid,
System.Collections.Hashtable atts, System.Type childType,
System.Web.UI.TemplateParser parser, ILocation location) [0x00000]
  at System.Web.Compilation.AspGenerator.ProcessTag (ILocation location,
System.String tagid, System.Web.Compilation.TagAttributes atts, TagType
tagtype, System.Boolean& ignored) [0x00000]  

--------------------------------------------------------------------------------
Version information: Mono Version: 2.0.50727.1433; ASP.NET Version:
2.0.50727.1433


Environment configuration:
==========================
- OpenSUSE 11.1
- Mono 2.4.2 with installed mono-basic 2.4.2




Reproducible: Always

Steps to Reproduce:
Given is the ASPX file with this content:

debopweb02:/srv/_default/htdocs # cat hello_world_csharp.aspx 
<%@ Page Language="C#" %>
<%@ Register TagPrefix="camm" TagName="WebManager"
Src="/system/cammWebManager.ascx" %> <camm:WebManager id="cammWebManager"
SecurityObject="@@Public" runat="server"></camm:WebManager> 
<html> 
<body> 
<% Response.Write ("<h1>This is a C# demo</h1>"); %> 
<h3><asp:Label runat="server" id="UserWelcome" /></h3> 
</body> 
</html> 
<script runat="server">
void Page_Load() {
    UserWelcome.Text = "And you are " +
cammWebManager.CurrentUserInfo().FullName() + "; a warm welcome to you!"; } 
</script>


Actual Results:  
As soon as I copy "cammWM.dll" or "camm.WebControls.dll" into the bin
directory, the compiler exception occurs

As soon as both files are removed from bin folder, it can compile (or let's say
it correctly shows an error message when compiling the hello_world_csharp.aspx
because the inherited class is not available (which is absolutely correct))

Expected Results:  
compilation should work in all cases

-- 
Configure bugmail: http://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
You are the assignee for the bug.


More information about the mono-bugs mailing list