[Mono-aspnet-list] Object reference not set to an instance of an object

ketil ketil at froyn.name
Thu Aug 6 11:45:42 EDT 2009


I have ported a (working) ASP.NET C# application from MS SQL/IIS to
MySQL/Mono. I'm running it under xsp2 for now, and I'm not compiling
anything.

I have a page with a simple form and a "Refresh" button that runs an SQL
query. This works fine the first time I click it, but if I click it once
more I get:

Error 500: Object reference not set to an instance of an object

System.NullReferenceException: Object reference not set to an instance of an
object
 at System.Web.UI.WebControls.SqlDataSourceView.LoadViewState (System.Object
savedState) [0x00000]
 at
System.Web.UI.WebControls.SqlDataSourceView.System.Web.UI.IStateManager.LoadView
State (System.Object savedState) [0x00000]
 at System.Web.UI.WebControls.SqlDataSource.LoadViewState (System.Object
savedState) [0x00000]
 at System.Web.UI.Control.LoadViewStateRecursive (System.Object savedState)
[0x00000]
 at System.Web.UI.Control.LoadViewStateRecursive (System.Object savedState)
[0x00000]
 at System.Web.UI.Control.LoadViewStateRecursive (System.Object savedState)
[0x00000]
 at System.Web.UI.Control.LoadViewStateRecursive (System.Object savedState)
[0x00000]
 at System.Web.UI.Control.LoadViewStateRecursive (System.Object savedState)
[0x00000]
 at System.Web.UI.Page.LoadPageViewState () [0x00000]
 at System.Web.UI.Page.RestorePageState () [0x00000]
 at System.Web.UI.Page.InternalProcessRequest () [0x00000]
 at System.Web.UI.Page.ProcessRequest (System.Web.HttpContext context)
[0x00000]

This works fine when I run it on Windows, so I'm sort of at a loss for why
this happens. And after I get this error here, I get the same error all over
the place in my application.

Also, the entire contents of my btnRefresh_Click() method is wrapped with a
try/catch (Exception ex) block, so it isn't even happening there. This seems
to be out of my control.

Anyone else experienced anything like this? 

I'm running Mono on Debian. Some versions:

Version information:  Mono Version: 2.0.50727.1433; ASP.NET Version:
2.0.50727.1433
mono-xsp2: 2.4.2-1
mono-gac: 2.4.2.3+dfsg-1

Cheers, Ketil
-- 
View this message in context: http://www.nabble.com/Object-reference-not-set-to-an-instance-of-an-object-tp24849093p24849093.html
Sent from the Mono - ASP.NET mailing list archive at Nabble.com.



More information about the Mono-aspnet-list mailing list