Telerik blogs

By default the RadControls installer adds the Telerik.Charting assembly to the GAC on the machine where the package is installed, as the Telerik.Charting assembly is used by more than one package - RadControls for ASP.NET AJAX and RadControls for Winforms. So, let's consider an example -- create a new web site and use at least one control from the suite. When you drag a control from the toolbox Visual Studio will automatically copy Telerik.Web.UI.dll to site's Bin folder. Telerik.Web.UI assembly refers to Telerik.Charting assembly. But as long as Telerik.Charting is in the GAC it will not be copied to the Bin folder. Instead, it will be registered in the web.config file like this:

    <compilation>
     
<assemblies>
       
<add assembly="Telerik.Charting, Version=2.0.4.0, Culture=neutral, PublicKeyToken=D14F3DCC8E3E8763"/>

You are probably guessing the possible issue here -- upon XCOPY deployment there will be no Telerik.Charting.dll on the server, the Telerik.Charting reference is not resolved, so you get this:

Parser Error Message: Could not load file or assembly 'Telerik.Charting, Version=2.0.4.0, Culture=neutral, PublicKeyToken=d14f3dcc8e3e8763' or one of its dependencies. The system cannot find the file specified.

At this time a question pops up - "What charting? I do not use any charts!" You can now remove the reference from web.config file or through the web site property pages and the problem is seemingly solved. Seemingly. You may lose the intellisense in the markup if for any reason you end up with no Telerik.Charting available - on the server or locally on your development machine. This issue seems to appear only in VisualStudio 2008. But, how to fix it? The answer is - always make sure that the referred assembly is provided. In our case - either remove the registration from web.config file as described above AND copy Telerik.Charting to the web site Bin folder or install Telerik.Charting to GAC (which might not be always possible). Note, that upgrading RadControls for ASP.NET AJAX to a newer version means that you need to replace both assemblies - Telerik.Web.UI and Telerik.Charting.

Finally, I have some inside info to share. Starting from Q3 2008, Telerik.Charting will be IL merged in Telerik.Web.UI, so you will never suffer such issues again. 


Comments

Comments are disabled in preview mode.