Our company purchased the Telerik tools 9/2010
I have read through the trouble shooting, but am unable to fix the issue.
Intermittently I get errors rendering the controls. I searched for the troubleshooting for it in this forum.
I arrived here:
Which tells me to go here:
Which tells me this:
Unable to cast object from type 'x' to type 'x'
Here is a problem I encountered while working with Visual Studio 2005 and 2008....
The last time this happened to me was while working on TFS custom control. So in order to create a custom control, we must add the assembly we have created and a wicc file to the following folder:
"C:\Documents and Settings\All Users\Application Data\Microsoft\Team Foundation\Work Item Tracking\Custom Controls\9.0"
This is the path where TFS (Team Explorer) will look at when using custom controls.
When I deployed a new version of the custom control to that location I suddenly started receiving the InvalidCastException telling me that it was:
"Unable to cast object of type 'x' to object of type 'x'"
So, what happened here? The common sense tells us that this should be a version issue.
What did I find out?
If you attach to a running instance of VS2005/8 and check what Modules are loaded (you may need to add the Modules window command from the Debug category in Tools --> Customize...) you'll probably see two versions of your assembly are loaded, or even the same version of the assembly loaded twice: in both cases you'll see the same error message.
Why does it happen?
The IDE uses cache to store the assemblies for its projects. The IDE caches versions of assemblies in the following folder:
"x\Documents and Settings\user\Local Settings\Application Data\Microsoft\VisualStudio\8.0\ProjectAssemblies"
And at least in my case doesn't detect the particular assembly containing the type has a new version and it doesn't update the cache.
How do I solve it?
So first step, delete all folders in ProjectAssemblies. Next, make sure the IDE can only find ONE copy of your assembly, which is easier if you only have one copy of the DLL in your disk, and only one reference to it (or exactly the same reference from all projects) in your solution
Which I did. I had two folders in the location listed above. Both had telerik.dll in them.
I deleted both, but the error resumed shortly after, and both folders are back.
I also, when I create a new TELERIK project, have selection of 'TRIAL' or version 2010.2.826.40
I have UNINSTALLED the trial. I would have assumed that the problem above is that multiple copies of the DLL are getting loaded, and that is causing the IDE to freak out. Having uninstalled the telerik DEMO, I would have thought that would have fixed it.
Can you please explain how I 'make sure the IDE can only find ONE copy of your assembly, which is easier if you only have one copy of the DLL in your disk
I am hesitant to upgrade to the latest version because the last thing I want is yet another error being produced due to clashing references.