moved from iis5 to iis6

T

Terry Strachan

Hi,

I have an asp.net webapp that works fine on my development machine,
win2k/iis5 however, when I move the site across to win2k3 / iis6 i get the
following error on postback of any page;

*------------------------------------------*
Object reference not set to an instance of an object.
Description: An unhandled exception occurred during the execution of the
current web request. Please review the stack trace for more information
about the error and where it originated in the code.
Exception Details: System.NullReferenceException: Object reference not set
to an instance of an object.
*------------------------------------------*

This error only ocours on postback of a page standard aspx pages with code
behind etc work fine, but on postback - bang. I assume its a setting
somewhere to tweak as it works fine on iis5.

I have tried IIS5 Issolation mode in IIS6 but it is still the same.

Any advice?

Many thanks

Terry.
 
K

Karl Seguin [MVP]

Without code and a line number it's impossible to debug. There's nothing
specific about iis 6 that jumps in my mind. NullReference errors tend to be
_very_ easy to debug though...If you deploy your pdb and get a line #,
you'll have it fixed in a couple minutes.

Karl
 
T

Terry Strachan

Thanks for the reply,
I have access to the code and line number (see below), however,
I am at a loss as to why the exact same webpages run on my IIS5 machine.


Private Sub btnLogin_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles btnLogin.Click

Dim oWebUser As cmvWebUser = New cmvWebUser
Dim oUser As cmvUser = New cmvUser

If tbUserName.Text = "" Or tbPassword.Text = "" Then
lblMissing.Text = "Please enter user ID and password"
Else
oUser = oWebUser.LogOn(tbUserName.Text, tbPassword.Text,
Session.SessionID)

Dim oRegistration As cmvRegistration = New cmvRegistration
*-->>>If oUser.Security = "ADMIN" Then

oRegistration =
oRegistration.GetRegistration(tbUserName.Text)

If oRegistration.Approved = "A" Then
Response.Redirect("/client/activation.aspx?UserID=" &
tbUserName.Text)
End If

If oRegistration.Approved = "N" Then
Response.Redirect("/client/approve.aspx")
End If

End If

End Sub


The oWebUser.LogOn method interacts with our back office system (mvbase) to
verify the login details. I have a telnet session logged on to the same
port so I can watch the transaction however, it doesnt fire.

It stops at the oUser.Security = "ADMIN" line, which the object is created
a few lines before from class cmvUser.

I am trying to set up remote debugging to see what is and isnt firing, but
windows 2000, VSNet 2003 on my development machine and Win 2003 and iis6 on
my server are giving me all sorts of problems and many hours googling... I
am at a stage now where I need to install the remote debugging components on
the server, only to find the disc isnt on site. It will have to wait till
tmrw.

Terry.

"Karl Seguin [MVP]" <karl REMOVE @ REMOVE openmymind REMOVEMETOO . ANDME
net> wrote in message news:[email protected]...
 
R

Ray Booysen

Terry said:
Thanks for the reply,
I have access to the code and line number (see below), however,
I am at a loss as to why the exact same webpages run on my IIS5 machine.


Private Sub btnLogin_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles btnLogin.Click

Dim oWebUser As cmvWebUser = New cmvWebUser
Dim oUser As cmvUser = New cmvUser

If tbUserName.Text = "" Or tbPassword.Text = "" Then
lblMissing.Text = "Please enter user ID and password"
Else
oUser = oWebUser.LogOn(tbUserName.Text, tbPassword.Text,
Session.SessionID)

Dim oRegistration As cmvRegistration = New cmvRegistration
*-->>>If oUser.Security = "ADMIN" Then

If the logon method fails wouldn't oUser be null?

oRegistration =
oRegistration.GetRegistration(tbUserName.Text)

If oRegistration.Approved = "A" Then
Response.Redirect("/client/activation.aspx?UserID=" &
tbUserName.Text)
End If

If oRegistration.Approved = "N" Then
Response.Redirect("/client/approve.aspx")
End If

End If

End Sub


The oWebUser.LogOn method interacts with our back office system (mvbase) to
verify the login details. I have a telnet session logged on to the same
port so I can watch the transaction however, it doesnt fire.

It stops at the oUser.Security = "ADMIN" line, which the object is created
a few lines before from class cmvUser.

I am trying to set up remote debugging to see what is and isnt firing, but
windows 2000, VSNet 2003 on my development machine and Win 2003 and iis6 on
my server are giving me all sorts of problems and many hours googling... I
am at a stage now where I need to install the remote debugging components on
the server, only to find the disc isnt on site. It will have to wait till
tmrw.

Terry.

"Karl Seguin [MVP]" <karl REMOVE @ REMOVE openmymind REMOVEMETOO . ANDME
net> wrote in message news:[email protected]...
 
K

Karl Seguin [MVP]

Ya, again, I'm not sure what it is about IIS6..but your oWebUser.LogOn is
obviously returning null. I can't offer much more help other than suggest
that you look into that method and figure out under what circumstances it'd
be null...

Karl

--
http://www.openmymind.net/
http://www.fuelindustries.com/


Terry Strachan said:
Thanks for the reply,
I have access to the code and line number (see below), however,
I am at a loss as to why the exact same webpages run on my IIS5 machine.


Private Sub btnLogin_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles btnLogin.Click

Dim oWebUser As cmvWebUser = New cmvWebUser
Dim oUser As cmvUser = New cmvUser

If tbUserName.Text = "" Or tbPassword.Text = "" Then
lblMissing.Text = "Please enter user ID and password"
Else
oUser = oWebUser.LogOn(tbUserName.Text, tbPassword.Text,
Session.SessionID)

Dim oRegistration As cmvRegistration = New cmvRegistration
*-->>>If oUser.Security = "ADMIN" Then

oRegistration =
oRegistration.GetRegistration(tbUserName.Text)

If oRegistration.Approved = "A" Then
Response.Redirect("/client/activation.aspx?UserID=" &
tbUserName.Text)
End If

If oRegistration.Approved = "N" Then
Response.Redirect("/client/approve.aspx")
End If

End If

End Sub


The oWebUser.LogOn method interacts with our back office system (mvbase)
to
verify the login details. I have a telnet session logged on to the same
port so I can watch the transaction however, it doesnt fire.

It stops at the oUser.Security = "ADMIN" line, which the object is
created
a few lines before from class cmvUser.

I am trying to set up remote debugging to see what is and isnt firing, but
windows 2000, VSNet 2003 on my development machine and Win 2003 and iis6
on
my server are giving me all sorts of problems and many hours googling...
I
am at a stage now where I need to install the remote debugging components
on
the server, only to find the disc isnt on site. It will have to wait till
tmrw.

Terry.

"Karl Seguin [MVP]" <karl REMOVE @ REMOVE openmymind REMOVEMETOO . ANDME
net> wrote in message news:[email protected]...
 
T

Terry Strachan

I now have remote debugging set up and working and you were both right - the
logon method was returning a null. The problem had nothing to do with IIS,
or the OS, or VS... My error trapping wasn't very good.

The problem lay with the third party database connection software (mv.net) I
had configured it slightly wrong on the server but right on my test machine.

Ooops

Thanks for your help.

Terry.

"Karl Seguin [MVP]" <karl REMOVE @ REMOVE openmymind REMOVEMETOO . ANDME
net> wrote in message news:[email protected]...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,577
Members
45,052
Latest member
LucyCarper

Latest Threads

Top