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
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