[Pkg-mono-devel] Errors in ASP.NET

Tomasz Rybak bogomips@post.pl
Wed, 22 Sep 2004 19:30:15 +0200


W li¶cie z wto, 21-09-2004, godz. 19:53, Tomasz Rybak pisze: 
> dbpage1.aspx and dbpage2.aspx:
> Server error in '/samples' application
> 
> ________________________________________________________________________
> Description: Error processing request. 
> 
> Error Message: HTTP 500. 
> 
> Stack Trace: 
> System.NullReferenceException: Object reference not set to an instance of an object
> in [0x0001d] (at /tmp/90370.0.cs:149) ASP.dbpage2_aspx:Page_Init (object,System.EventArgs)
> in <0x00069> (wrapper delegate-invoke) System.MulticastDelegate:invoke_void_object_EventArgs (object,System.EventArgs)
> in [0x00030] (at /home/inet/debian/dev/build-area/mcs-1.0.1/class/System.Web/System.Web.UI/Control.cs:566) System.Web.UI.Control:OnInit (System.EventArgs)
> in [0x000e2] (at /home/inet/debian/dev/build-area/mcs-1.0.1/class/System.Web/System.Web.UI/Control.cs:865) System.Web.UI.Control:InitRecursive (System.Web.UI.Control)
> in [0x00023] (at /home/inet/debian/dev/build-area/mcs-1.0.1/class/System.Web/System.Web.UI/Page.cs:734) System.Web.UI.Page:InternalProcessRequest ()
> in [0x00052] (at /home/inet/debian/dev/build-area/mcs-1.0.1/class/System.Web/System.Web.UI/Page.cs:720) System.Web.UI.Page:ProcessRequest (System.Web.HttpContext)
> in [0x00091] (at /home/inet/debian/dev/build-area/mcs-1.0.1/class/System.Web/System.Web/HttpApplication.cs:444) ExecuteHandlerState:Execute ()
> in [0x0001e] (at /home/inet/debian/dev/build-area/mcs-1.0.1/class/System.Web/System.Web/HttpApplication.cs:708) StateMachine:ExecuteState (System.Web.HttpApplication/IStateHandler,bool&)
> 
> I have PostgreSQL, but I don't have required databases. However, this 
> should be caught and ShowError should be called.
> 

This error is caused by wrong web.config file.
There should be 
        <add key="DBProviderAssembly"
             value="Npgsql"/>
        <add key="DBConnectionType"
             value="Npgsql.NpgsqlConnection"/>
but is 
        <add key="DBProviderAssembly"
             value="Mono.Data.PostgreSqlClient"/>
        <add key="DBConnectionType"
             value="Mono.Data.PostgreSqlClient.PgSqlConnection"/>
In xsp-1.0.1.tar.gz from http://mono2.ximian.com/archive/1.0.1/
web.config is correct.

-- 
Tomasz Rybak <bogomips@post.pl>