|
-
Jan 7th, 2009, 03:50 PM
#1
Thread Starter
Member
[RESOLVED] Can't get stack trace from OjbectDisposedException
Hi all,
I'm very confused on something and I'm hoping you can help. We have this funky little ObjectDisposedException happening now and again. But only on production machines, of course ... can't recreate the issue on my dev unit. So I trotted on out to the Microsoft site to see what members of this exception I could use to figure out what's going on. Microsoft says that one of the members is StackTrace. I double and triple checked that I'm looking at .Net 1.1 information as I'm pretty sure that's what I'm using (how can I check that?). Here's the page I found - http://msdn.microsoft.com/en-us/libr...rs(VS.71).aspx
So I go back to my program to write something useful to the event log so I can figure out what's going on. And when I look at the members of the ObjectDisposedException available to me I only see the following: GetBaseException, GetType, InnerException, Message, ObjectName, ToString.
I'm so lost... what happened to my StackTrace member? I sure could use it if I could figure out how to get to it.
Thanks!!
-
Jan 7th, 2009, 06:52 PM
#2
Re: Can't get stack trace from OjbectDisposedException
An ObjectDisposedException object definitely has a StackTrace property because it's inherited from the Object class. I think you must have the Common tab selected in the Intellisense popup list. Select the All tab and you'll see the rest of the members.
Note that I generally just call ToString on an exception as it gives you the type, error message and stack trace all in a single string.
VS.NET 2002 => .NET 1.0
VS.NET 2003 => .NET 1.1 by default, can select .NET 1.0 or both
VS 2005 => .NET 2.0, can select .NET 3.0 with extensions installed
VS 2008 => .NET 3.5 by default, can select .NET 2.0 or .NET 3.0
-
Jan 8th, 2009, 11:42 AM
#3
Thread Starter
Member
Re: Can't get stack trace from OjbectDisposedException
Thanks! I'll try the ToString thing. But I'm confused what you mean with tabs. When I type the "." that ends the name of the exception, Intellisense presents the options I mentioned. But there's no "common" or "all" tabs or any tabs at all. Is this something post VS2003 maybe? (yes, I'm stuck with using 2003 for now.. long story, not happy, it's the way it is ;-) ).
-
Jan 8th, 2009, 11:48 AM
#4
Re: Can't get stack trace from OjbectDisposedException
I don't have VS.NET 2003 installed at home anymore so I can't test this theory but, if I remember correctly, you can press Ctrl+Space when the Intellisense popup list appears and it will display the rest of the item's members.
Regardless of that, it doesn't really matter what Intellisense says because if an object has a member then it has the member. The fact that you can't select it from Intellisense doesn't mean you can't type the name out in full. There are some members, like NumericUpDown.Text, that have been expressly hidden from Intellisense because they should generally not be used but if they exist then you can use them.
-
Jan 8th, 2009, 12:05 PM
#5
Thread Starter
Member
Re: Can't get stack trace from OjbectDisposedException
I love the CTRL-Space thing and will have to explore it further. But it shows everything (even some of my procedures), not just what's relative to the exception. But I tried using .StackTrace anyway and got a message that it's not a member. (VB put the parens behind stacktrace, not me).

Too weird. I do appreciate the help, by the way.... it just seems like my copy of this is different. Why doesn't that surprise me.. sure fits my luck! LOL
-
Jan 8th, 2009, 12:17 PM
#6
Re: Can't get stack trace from OjbectDisposedException
That's really bizarre. I just checked the documentation to confirm what I was sure was the case and it says that StackTrace has been a member of the Exception class since .NET 1.0. I have no explanation for that.
-
Jan 8th, 2009, 12:21 PM
#7
Thread Starter
Member
Re: Can't get stack trace from OjbectDisposedException
Very, very strange, that's for sure. But thanks for the help. Once again, it seems I'm programming in the Twilight Zone. But, let's look on the bright side... one day when I get another gig, it'll sure seem easy! LOL Thanks again for the help.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|