Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Exception of type System.StackOverflowException was thrown.

Status
Not open for further replies.

Transcend

Programmer
Sep 29, 2002
858
AU
When I run my asp app i get this error:
Exception of type System.StackOverflowException was thrown.

I have a property in a config.vb file called username that i'm trying to set using windows integrated authentication

Public Shared Property UserName() As String
Get
Return mstrUserName
End Get
Set(ByVal Value As String)
UserName = Value
End Set
End Property

It seems that when i try to do this by doing:

Config.UserName = Utilities.GetUserName

I get the above error,
any ideas?

Transcend
[gorgeous]

 
Of course i mean, asp .NET app ...

Transcend
[gorgeous]
 
Never mind solved it

i now have

Private Shared mstrUserName As String = ConfigurationSettings.AppSettings("UserName")

Public Shared Property UserName() As String
Get
Return mstrUserName
End Get
Set(ByVal Value As String)
mstrUserName = Value
End Set
End Property


Transcend
[gorgeous]
 
I was going to suggest you look for uncontrolled recursion -- my primary target when I see a stack overflow.

Which, looking at your first post, is what you had. In the property/set you were calling yourself, instead of the private member variable.

As you found out.
;)

Chip H.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top