Unable to cast object of type 'ASP.

Discussion in 'ASP .Net' started by msnews.microsoft.com, Dec 14, 2006.

  1. Greetings

    I recently started at a new job and was involved in migrating their product
    from Visual Studio 2003 to Visual Studio 2005, and everything seemed to have
    gone very well until recently when I noticed the following message occurring
    on one of the user controls was throwing the following error

    Unable to cast object of type 'ASP.

    And this was the offending line of code that was causing it.
    ctlPatient = LoadControl("~/patients/ctlPatientTable.ascx")

    I did some googling on this and came across a number of sites but no real
    solution, except that it has something to do with VS2005 caching. My work
    around for anytime it occurs on my machine is to do the following:

    1. Stop IIS with IISRESET /STOP
    2. Close VS2005
    3. Go to asp.net temp directory
    4. Find the project folder and delete all contents
    5. Restart IIS
    6. Run VS2005 again and hey presto the error message goes away.

    Not the ideal solution but it works for what I have to do. However, I am not
    exactly sure why it believes this line is the error, when no one has touched
    this file in a while and it seems to happen randomly. So it is hard to track
    down what is causing it. Has any one ever encountered this error and if so
    what was the cause and solution. Thanks.

    John
    msnews.microsoft.com, Dec 14, 2006
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    2
    Views:
    3,063
    silverfox_1188
    Aug 16, 2006
  2. Replies:
    0
    Views:
    907
  3. Replies:
    1
    Views:
    1,143
  4. BillE
    Replies:
    0
    Views:
    449
    BillE
    Nov 8, 2006
  5. GaryDean
    Replies:
    4
    Views:
    5,441
    ketanbece
    Dec 2, 2008
Loading...

Share This Page