Posted
on Feb 10, 2011
(permalink)
After months of bearing the annoyance of this issue (it only applied to some of my controls), today it blossomed and happened with all my controls. I spent 4 hours pouring over the forums and trying everything. Here's what I learned:
I'm using Visual Web Developer Express Edition 10.0
I tried everything on this post, including blog solutions, to no avail. Tried reinstalling VWDE10 to no avail. Tried reinstalling RadControls no avail.
Then, here's my episode to get things working...
------------------------------------------------------------------------------------------------------
Finally got an error that helped me find my solution:
System.InvalidCastException: [A]Telerik.Web.UI.RadGrid cannot be cast to [B]Telerik.Web.UI.RadGrid. Type A originates from 'Telerik.Web.UI, Version=2010.1.519.35...' at location 'C:\Users\Mark\AppData\Local\Microsoft\VWDExpress\10.0\ProjectAssemblies\eo8jjiae01\Telerik.Web.UI.dll' , and B) is located at C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\PublicAssemblies
I erased the DLL at "C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\PublicAssemblies" and restarted VWD.
Everything worked.
Tried to add a rad control from my toolbox and...
Got similar error again only slightly different:
System.InvalidCastException: [A]Telerik.Web.UI.RadGrid cannot be cast to [B]Telerik.Web.UI.RadGrid. Type A originates from 'Telerik.Web.UI, Version=2010.1.519.35...' at location 'C:\Users\Mark\AppData\Local\Microsoft\VWDExpress\10.0\ProjectAssemblies\eo8jjiae01\Telerik.Web.UI.dll', and B) is located at 'C:\Users\Mark\AppData\Local\Microsoft\VWDExpress\10.0\ProjectAssemblies\qgrgfrem01\Telerik.Web.UI.dll'
I noticed that the control I added from the toolbox was a version .35 control (after clicking 'Choose Items' on toolbox). That placed a version .35 DLL in that 'C:\Users\Mark\AppData\Local\Microsoft\VWDExpress\10.0\ProjectAssemblies\qgrgfrem01\Telerik.Web.UI.dll' folder and triggered the errors and confusion once again.
In the end I have decided to keep only version .20 controls in my toolbox and this seems to work.
Here's the final configuration that works for me:
Config file:
------------------------------------------------------------------------------------------------------
<httpHandlers>
<add verb="*" path="Telerik.RadUploadProgressHandler.ashx" type="Telerik.Web.UI.RadUploadProgressHandler, Telerik.Web.UI" validate="false"/>
<add path="Telerik.Web.UI.WebResource.axd" verb="*" type="Telerik.Web.UI.WebResource, Telerik.Web.UI" validate="false"/>
<add path="Telerik.Web.UI.SpellCheckHandler.axd" verb="*" type="Telerik.Web.UI.SpellCheckHandler, Telerik.Web.UI, Version=2010.1.519.20, Culture=neutral, PublicKeyToken=121fae78165ba3d4" validate="false"/>
</httpHandlers>
<assemblies>
<add assembly="Telerik.Web.Design, Version=2010.1.519.20, Culture=neutral, PublicKeyToken=121fae78165ba3d4"/>
</assemblies>
- One strange thing to me is that I can change the version to 519.40 or 519.20 in the spellcheckhandler line and not notice any difference - yet.
- At first I had the code read:
<assemblies>
<add assembly="Telerik.Web.Design, Culture=neutral"/>
</assemblies>
But upon compilation, it griped that it couldn't find the file.
So changed it to this and it worked:
<assemblies>
<add assembly="Telerik.Web.Design, Version=2010.1.519.20, Culture=neutral, PublicKeyToken=121fae78165ba3d4"/>
</assemblies>
DLLs
------------------------------------------------------------------------------------------------------
Version 2010.1.519.20 at
C:\Users\Mark\AppData\Local\Microsoft\VWDExpress\10.0\ProjectAssemblies\qgrgfrem01\Telerik.Web.UI.dll
- Having DLLs in Bin or not does not seem to matter. VS seems to add this file to my bin automatically at it's discretion.
- NO DLL in C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\PublicAssemblies
c:\Windows\Assembly
------------------------------------------------------------------------------------------------------
Still have
Telerik.Web.Design 2010.1.519.35
Telerik.Web.Design 2010.1.519.20
-Hopefully having both doesn't cause problems. Can't delete them.
One final note, kind of for me and you too:
- For a long time, most of my radcontrols showed fine in the development environment, but some did not, and gave a similar error. I think this happened because my solution uses controls from older versions and the newer versions. I'm now guessing this is not a good idea, although it seems strange. You'd think Telerik would want us to upgrade. I'm guessing there's something about upgrading that I just don't understand or maybe some kinks they need to work out. Regardless, now, with the version .20 DLL in place, and using only version .20 controls in my toolbox all the controls seem to work properly.