Microsoft Content Management Server - Specified cast is not valid

This is Interesting: Free IT Magazines  
Home > Archive > Microsoft Content Management Server > June 2005 > Specified cast is not valid





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author Specified cast is not valid
Lam

2005-06-21, 2:49 am

Hi all,

I'm using VB.net in my project and I'm getting this error when assigning the
HttpContext user identity to windows identity. FYI, i must use
AuthenticateUsingUserHandle method.

Dim cmsAppContext As New CmsApplicationContext
Dim winIdent As System.Security.Principal.WindowsIdentity =
HttpContext.Current.User.Identity

cmsAppContext.AuthenticateUsingUserHandle(winIdent.Token,
PublishingMode.Unpublished)

How can I go about it?

Sample in C# is here
http://support.microsoft.com/?kbid=327750

Thanks

jawadak@gmail.com

2005-06-21, 8:49 pm

Lam before you assign it make sure it is not null make a check like
this

HttpContext.Current.User.Identity.IsAuthenticated ....For Guest users
it will be null ...

Chester Ragel

2005-06-22, 2:49 am

Hi Lam,

I checked your code and it works without any problem for me. Can you post
the exact error message that you get when you build the project?

Cheers,
Chester.

"Lam" <Lam@discussions.microsoft.com> wrote in message
news:C174C221-70FB-4D82-A96E-7B667915FFB1@microsoft.com...
> Hi all,
>
> I'm using VB.net in my project and I'm getting this error when assigning

the
> HttpContext user identity to windows identity. FYI, i must use
> AuthenticateUsingUserHandle method.
>
> Dim cmsAppContext As New CmsApplicationContext
> Dim winIdent As System.Security.Principal.WindowsIdentity =
> HttpContext.Current.User.Identity
>
> cmsAppContext.AuthenticateUsingUserHandle(winIdent.Token,
> PublishingMode.Unpublished)
>
> How can I go about it?
>
> Sample in C# is here
> http://support.microsoft.com/?kbid=327750
>
> Thanks
>



Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com