[Mono-list] ASP.Net compilation error with VB and C# and Mono V2.4.2

Jochen Wezel - CompuMaster GmbH jwezel at compumaster.de
Tue Jun 30 10:48:11 EDT 2009


Hello,

I've got this error when trying to access my test website and if I've put a file "cammWM.dll" into my bin directory:

Server Error in '/' Application

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

VBNC_CRASH: Visual Basic.Net Compiler version 0.0.0.5914 (Mono 2.4.2 - r) Copyright (C) 2004-2008 Rolf Bjarne Kvinge. All rights reserved. 
Error : VBNC99999: Unexpected error: The classes in the module cannot be loaded.
at (wrapper managed-to-native) System.Reflection.Assembly:GetTypes (bool) at System.Reflection.Assembly.GetTypes () [0x00000] in /usr/src/packages/BUILD/mono-2.4.2/mcs/class/corlib/System.Reflection/Assembly.cs:348 at vbnc.TypeManager.LoadReferencedTypes () [0x00028] in /usr/src/packages/BUILD/mono-basic-2.4.2/vbnc/vbnc/source/General/TypeManager.vb:441 at vbnc.TypeManager.LoadReferenced () [0x000e3] in /usr/src/packages/BUILD/mono-basic-2.4.2/vbnc/vbnc/source/General/TypeManager.vb:306 at vbnc.Compiler.Compile () [0x001e2] in /usr/src/packages/BUILD/mono-basic-2.4.2/vbnc/vbnc/source/General/Compiler.vb:534 
Compilation took 00:00:00.8301500 
Description: HTTP 500. Error processing request.

Stack Trace: 

System.Web.Compilation.CompilationException: VBNC_CRASH: Visual Basic.Net Compiler version 0.0.0.5914 (Mono 2.4.2 - r)
Copyright (C) 2004-2008 Rolf Bjarne Kvinge. All rights reserved.

Error : VBNC99999: Unexpected error: The classes in the module cannot be loaded.  at (wrapper managed-to-native) System.Reflection.Assembly:GetTypes (bool)
  at System.Reflection.Assembly.GetTypes () [0x00000] in /usr/src/packages/BUILD/mono-2.4.2/mcs/class/corlib/System.Reflection/Assembly.cs:348 
  at vbnc.TypeManager.LoadReferencedTypes () [0x00028] in /usr/src/packages/BUILD/mono-basic-2.4.2/vbnc/vbnc/source/General/TypeManager.vb:441 
  at vbnc.TypeManager.LoadReferenced () [0x000e3] in /usr/src/packages/BUILD/mono-basic-2.4.2/vbnc/vbnc/source/General/TypeManager.vb:306 
  at vbnc.Compiler.Compile () [0x001e2] in /usr/src/packages/BUILD/mono-basic-2.4.2/vbnc/vbnc/source/General/Compiler.vb:534 Compilation took 00:00:00.8301500

  at System.Web.Compilation.AssemblyBuilder.BuildAssembly (System.Web.VirtualPath virtualPath, System.CodeDom.Compiler.CompilerParameters options) [0x00000] 
  at System.Web.Compilation.AssemblyBuilder.BuildAssembly (System.Web.VirtualPath virtualPath) [0x00000] 
  at System.Web.Compilation.BuildManager.GenerateAssembly (System.Web.Compilation.AssemblyBuilder abuilder, System.Collections.Generic.List`1 buildItems, System.Web.VirtualPath virtualPath, BuildKind buildKind) [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.BuildManager.CreateInstanceFromVirtualPath (System.String virtualPath, System.Type requiredBaseType) [0x00000] 
  at System.Web.UI.PageParser.GetCompiledPageInstance (System.String virtualPath, System.String inputFile, System.Web.HttpContext context) [0x00000] 
  at System.Web.UI.PageHandlerFactory.GetHandler (System.Web.HttpContext context, System.String requestType, System.String url, System.String path) [0x00000] 
  at System.Web.HttpApplication.GetHandler (System.Web.HttpContext context, System.String url, Boolean ignoreContextHandler) [0x00000] 
  at System.Web.HttpApplication.GetHandler (System.Web.HttpContext context, System.String url) [0x00000] 
  at System.Web.HttpApplication+<Pipeline>c__Iterator2.MoveNext () [0x00000]  

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


Given is the ASPX file with this content:
debopweb02:/srv/_default/htdocs # cat index.aspx
<%@ Page %>
<html><body>TEST
<p>.NET Version=<%= System.Environment.Version.ToString %>
<p>Now=<%= Now %>
<p>IP Remote User=<%= Request.ServerVariables("REMOTE_ADDR") %></body></html>


The same executed with C# works; here is the content:

debopweb02:/srv/_default/htdocs # cat index.cs.aspx
<%@ Page Language="C#" %>
<html><body>TEST
<p>.NET Version=<%= System.Environment.Version.ToString() %>
<p>Now=<%= System.DateTime.Now.ToString() %>
<p>IP Remote User=<%= Request.ServerVariables["REMOTE_ADDR"] %>
</body></html>


Both, C# and VB.NET fail 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


In case you need my cammWM.dll for testing purposes, please tell me your e-mail address so that I can send it directly to you (it shall be handled confidentially).

Environment configuration:
==========================
- OpenSUSE 11.1
- Mono 2.4.2 with installed mono-basic 2.4.2 (installed with zypper as advised by mono website)


Regards
Jochen



More information about the Mono-list mailing list