[Mono-dev] Problem integrating CodeDom provider with web application

David Harms d.harms at covecomm.com
Tue Jan 8 17:17:12 EST 2008


I've looked in the archives but haven't found any directly relevant 
information, so I hope someone can help me. I have a web app that runs 
on Windows, and I'm unable to get it running on Mono. This app is built 
with a beta release of Clarion#, which has a CodeDom provider for 
ASP.NET applications. I'm getting a 500 error (see below) seemingly 
related to a problem with the CodeDom provider, as it happens when xsp2 
attempts to compile a Clarion-language source file.

Here's the compiler entry for web.config:
       <compiler language="Clarion.Net;Clarion#" 
extension=".cln;.inn;.inc;.int" type="ClarionCompiler.CodeProvider, 
SoftVelocity.Clarion.ClarionCodeProvider, 
PublicKeyToken=4aca31c24e330653" />

My global.asax has one line:

--------------------------------------------------------
<%@ Application Language="Clarion.Net" CodeFile="Global.asax.cln" 
Inherits="ASP.Global"%>
--------------------------------------------------------

And Global.asax.cln looks like this:

--------------------------------------------------------
         MEMBER('')
         NAMESPACE('ASP')

         USING('System')
         USING('System.Collections')
         USING('System.ComponentModel')
         USING('System.Web')
         USING('System.Web.SessionState')

Global                          CLASS(System.Web.HttpApplication), PARTIAL
Application_Start               PROCEDURE(Object sender, EventArgs e), 
PROTECTED
Session_Start                   PROCEDURE(Object sender, EventArgs e), 
PROTECTED
Application_BeginRequest        PROCEDURE(Object sender, EventArgs e), 
PROTECTED
Application_EndRequest          PROCEDURE(Object sender, EventArgs e), 
PROTECTED
Application_AuthenticateRequest PROCEDURE(Object sender, EventArgs e), 
PROTECTED
Application_Error               PROCEDURE(Object sender, EventArgs e), 
PROTECTED
Session_End                     PROCEDURE(Object sender, EventArgs e), 
PROTECTED
Application_End                 PROCEDURE(Object sender, EventArgs e), 
PROTECTED
                                END

Global.Application_Start               PROCEDURE(Object sender, EventArgs e)
    CODE

Global.Session_Start                   PROCEDURE(Object sender, EventArgs e)
    CODE

Global.Application_BeginRequest        PROCEDURE(Object sender, EventArgs e)
    CODE

Global.Application_EndRequest          PROCEDURE(Object sender, EventArgs e)
    CODE

Global.Application_AuthenticateRequest PROCEDURE(Object sender, EventArgs e)
    CODE

Global.Application_Error               PROCEDURE(Object sender, EventArgs e)
    CODE

Global.Session_End                     PROCEDURE(Object sender, EventArgs e)
    CODE

Global.Application_End                 PROCEDURE(Object sender, EventArgs e)
    CODE
--------------------------------------------------------

It may look a bit strange but that's all valid Clarion code, and it does 
work under Windows. However,  on Mono any attempt to view a page yields 
the following 500 error:

--------------------------------------------------------
                                    Error 500
                                                  Server Error in '/' 
Application
     
______________________________________________________________________________________________________________________

Object reference not set to an instance of an object

   Description: Error processing request.

   Error Message: HTTP 500. System.NullReferenceException: Object 
reference not set to an instance of an object

   Stack Trace:

System.NullReferenceException: Object reference not set to an instance 
of an object
  at System.Web.Compilation.BaseCompiler.GetCompiledType () [0x00000]
  at System.Web.Compilation.AspGenerator.GetCompiledType () [0x00000]
  at System.Web.UI.ApplicationFileParser.GetCompiledApplicationType 
(System.String inputFile, System.Web.HttpContext context) [0x000
00]
  at System.Web.HttpApplicationFactory.InitType (System.Web.HttpContext 
context) [0x00000]

   System.Web.HttpException: ---&gt; System.NullReferenceException: 
Object reference not set to an instance of an object at
   System.Web.Compilation.BaseCompiler.GetCompiledType () [0x00000] at 
System.Web.Compilation.AspGenerator.GetCompiledType ()
   [0x00000] at 
System.Web.UI.ApplicationFileParser.GetCompiledApplicationType 
(System.String inputFile,
   System.Web.HttpContext context) [0x00000] at 
System.Web.HttpApplicationFactory.InitType (System.Web.HttpContext context)
   [0x00000] --- End of inner exception stack trace ---
--------------------------------------------------------

xsp2 shows an error at the same time:

--------------------------------------------------------
error CLA00430: Unrecognized option: /tmp/tmp30810c0b.tmp
--------------------------------------------------------

I've asked the SV folks about the meaning of the error but don't have a 
reply yet.

The temp file is valid Clarion code, as follows:

--------------------------------------------------------
-------------------
!!------------------------------------------------------------------------------ 

!! <autogenerated>
!!     This code was generated by a tool.
!!     Runtime Version: 2.0.50727.42
!!
!! </autogenerated>
!!------------------------------------------------------------------------------ 


    MEMBER('')

    NAMESPACE('ASP')



Global    CLASS(),TYPE,NETCLASS,PARTIAL,PUBLIC
Profile                      PROPERTY, 
^System.Web.Profile.DefaultProfile,PROTECTED,GETONLY
        INLINE
        GETTER

         CODE
            RETURN ((SELF.Context.Profile TRYAS 
System.Web.Profile.DefaultProfile))
         END

    END

    NAMESPACE('ASP')

 USING('System')
 USING('System.Collections')
 USING('System.Collections.Specialized')
 USING('System.Configuration')
 USING('System.Text')
 USING('System.Text.RegularExpressions')
 USING('System.Web')
 USING('System.Web.Caching')
 USING('System.Web.SessionState')
 USING('System.Web.Security')
 USING('System.Web.Profile')
 USING('System.Web.UI')
 USING('System.Web.UI.WebControls')
 USING('System.Web.UI.HtmlControls')


global_asax    CLASS(ASP.Global),TYPE,NETCLASS,PUBLIC
__initialized                ^BOOL,PRIVATE,STATIC
CONSTRUCT                    PROCEDURE(),PUBLIC
        INLINE
        CODE
        IF global_asax.__initialized = false
            global_asax.__initialized := true
        END
        END

    END

!!End of compile unit
--------------------------------------------------------
   
Can anyone shed any light on what's happening here? It appears the 
Clarion CodeDom provider is being used, since the partial class is being 
generated. Is there some other step needed to make the provider fully 
functional? Many thanks.

Dave






More information about the Mono-devel-list mailing list