Unable to cast object of type 'ASP.

  • Thread starter msnews.microsoft.com
  • Start date
M

msnews.microsoft.com

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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,767
Messages
2,569,572
Members
45,046
Latest member
Gavizuho

Latest Threads

Top