Charting dll in project and gac

Thread is closed for posting
4 posts, 0 answers
  1. Gary
    Gary avatar
    16 posts
    Member since:
    Oct 2012

    Posted 06 Oct 2008 Link to this post

    Hi

    Hi I am getting this type of error when building my project

    Error 8 The type 'Telerik.Charting.Styles.FillStylePlotArea' exists in both 'c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\ckb2dev\90654c09\5fb793c9\assembly\dl3\b788fc40\00729b82_ff22c901\Telerik.Charting.DLL' and 'c:\WINDOWS\assembly\GAC_MSIL\Telerik.Charting\2.0.3.0__d14f3dcc8e3e8763\Telerik.Charting.dll' c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\ckb2dev\90654c09\5fb793c9\App_Web_oe_edcar.2.cs 5799 

    Ie the charting dll in the gac contains the same types as the dll in the project

    I have removed the reference in the web.config for the 2.0.3 charting dll. In the project there is now a reference to the new 2.0.5 Telerik.Web.UI dll. This dll itself has a reference to the Charting 2.0.5 dll and thus during a build this dll also gets pulled into the projects references.

    This clashes with what is left in the GAC even though there are no project references to it. I have tried to remove the dll in the gac but even using gacutil it refuses. I have seen some posts on other web forums saying edit the registry to release the hold on this dll then remove it. This seems like a desperate approach and I thought you chaps could advise of a better solution before I do this.

    Thanks

    Gary

  2. Ves
    Admin
    Ves avatar
    2926 posts

    Posted 06 Oct 2008 Link to this post

    Hi Gary,

    There must be a reference to Telerik.Charting v2.0.3 in your project. If there is no such reference you will be able to use the newer version. Is it possible that you have a Register directive using the fully qualified name of Telerik.Charting in the page? This is how the Register directive is added by VS when the assembly is in the GAC. You can strip the version, culture and public key token when the assembly is not in the GAC.

    Hope this helps,
    Ves
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  3. Gary
    Gary avatar
    16 posts
    Member since:
    Oct 2012

    Posted 06 Oct 2008 Link to this post

    Hi

    Thanks for your speedy reply.

    Yes there was a few pages that had a register directive at the top of the page so I stripped them back to read as such

    <%

    @ Register Assembly="Telerik.Charting" Namespace="Telerik.Charting" TagPrefix="telerik" %>

    However on building I still got the complaint that it was confusing the types in the assembly in the gac with those within the local dll in the project bin. By this time I was quite satisfied thet there was no references in my project to the old dll in the gac yet somehow the project wanted to load it.

    I managed to remove the token in the registry theat marks the dll in the gac as having been installed via a msi and after doing that was able to use gacutil to remove the old 2.0.3 version from the gac. Following that proceedure the project now builds.

    From all that, logic would seem to point to that even though there was no reference to the project to a 2.0.3 charting dll by the simple fact that the assembly was named Telerik.Charting and some pages in the project register Telerik.Charting VS simply says "right I've got an assembly in the gac called Telerik.Charting so I'll try to load that" and then falls over when it's already got one loaded in the project's bin.

    Is this finding correct? If it is a would expect most people to have a similar issue when they apply this hotfix to upgrade to the latest version.

    Regards

    Gary


  4. Ves
    Admin
    Ves avatar
    2926 posts

    Posted 07 Oct 2008 Link to this post

    Hi Gary,

    I am afraid we are not able to reproduce this issue in our local tests. A GAC'ed assembly can only be used with its fully qualified name. Is it possible that the problem has been caused by caching? We did try this scenario with and without placing the new Telerik.Charting in GAC and either way the ambiguous error disappeared as soon as we removed all the references to the old assembly.

    Anyway, I am glad you have resolved it and I can assure you that with Q3 2008 this will no more be a problem, as we will IL merge Telerik.Charting into Telerik.Web.UI, thus eliminating such issues.

    All the best,
    Ves
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Back to Top