Having problem when Casting

2 posts, 0 answers
  1. Canis Lupus
    Canis Lupus avatar
    9 posts
    Member since:
    Aug 2012

    Posted 14 Mar 2011 Link to this post

    I am trying to use your sample AsyncUpload / Custom Handler

    I am getting Exception when I try to cast following code.

    Dim sampleConfiguration As SampleAsyncUploadConfiguration = New SampleAsyncUploadConfiguration
     
            Try
                sampleConfiguration = CType(configuration, SampleAsyncUploadConfiguration)
            Catch ex As Exception
     
            End Try
             
            If sampleConfiguration IsNot Nothing Then
                postID = sampleConfiguration.postID
            Else

    Here is the ex text:

    +                             ex           {"[A]SampleAsyncUploadConfiguration cannot be cast to [B]SampleAsyncUploadConfiguration. Type A originates from 'App_Web_xauu0n21, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null' in the context 'Default' at location 'C:\Users\myPC\AppData\Local\Temp\Temporary ASP.NET Files\mysite\b2f60de7\7f7ee92\App_Web_xauu0n21.dll'. Type B originates from 'App_Code.e2pu7rre, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null' in the context 'Default' at location 'C:\Users\myPC\AppData\Local\Temp\Temporary ASP.NET Files\mysite\b2f60de7\7f7ee92\App_Code.e2pu7rre.dll'."}                System.Exception


    Because of this ex, I get nothing in the "sampleConfiguration"

    Any work around to fix the problem?

    Thank you.

  2. Canis Lupus
    Canis Lupus avatar
    9 posts
    Member since:
    Aug 2012

    Posted 14 Mar 2011 Link to this post

    Fixed it nevermind :)
Back to Top