Re: Casting Problem
From: Scott Allen (bitmask_at_[nospam)
Date: 08/18/04
- Next message: Marina: "Re: Cookie is not created why ?"
- Previous message: Oytun YILMAZ: "Re: uniqueidentifier"
- In reply to: Carlo Marchesoni: "Re: Casting Problem"
- Next in thread: Carlo Marchesoni: "Re: Casting Problem"
- Reply: Carlo Marchesoni: "Re: Casting Problem"
- Messages sorted by: [ date ] [ thread ]
Date: Wed, 18 Aug 2004 09:51:30 -0400
Hi Carlo:
This does seem quite strange. I'm out of ideas on why it might behave
this way, unless there is some conversion operator or COM interop
going on behind the scences.
--s
On Tue, 17 Aug 2004 23:11:02 -0700, "Carlo Marchesoni"
<CarloMarchesoni@discussions.microsoft.com> wrote:
>Thank you for your hint Scott. I tried it and it drives me even more crazy,
>since in the debugger it works, but the same line "at runtime" fails.
>I put a breakpoint before the line, and inspected the Session variable:
>?System.Web.HttpContext.Current.Session["BackEnd"]
>{BackEnd}
> System.Object: {BackEnd}
> con: {com.Transoft.TCA.TCAConnection}
>
>looks okay, so I went ahead and assigned it to my private field, casting the
>session variable:
>this.backend = (BackEnd)System.Web.HttpContext.Current.Session["BackEnd"]
>{BackEnd}
> System.Object: {BackEnd}
> con: {com.Transoft.TCA.TCAConnection}
>
>and it works as well !!!
>But now comes the thing I don't understand: if I step to the next statement,
>which is exactly what I entered in the debugger window, it fails with the
>Specified cast is not valid
>message.
>
-- Scott http://www.OdeToCode.com
- Next message: Marina: "Re: Cookie is not created why ?"
- Previous message: Oytun YILMAZ: "Re: uniqueidentifier"
- In reply to: Carlo Marchesoni: "Re: Casting Problem"
- Next in thread: Carlo Marchesoni: "Re: Casting Problem"
- Reply: Carlo Marchesoni: "Re: Casting Problem"
- Messages sorted by: [ date ] [ thread ]