When inheriting from class TelerikSPRadGridWebPart I get reference error

4 posts, 0 answers
  1. Martin Lalonde
    Martin Lalonde avatar
    3 posts
    Member since:
    Jan 2010

    Posted 26 Nov 2014 Link to this post

    Hi,

    I've been trying to create a webpart that inherits from TelerikSPRadGridWebPart.  I created an Empty SharePoint 2010 project in Visual Studio and reference Telerik.Ajax.SharePoint from the GAC : C:\Windows\assembly\GAC_MSIL\Telerik.Ajax.SharePoint\2014.3.1024.35__aa9e5f693af67c7b\Telerik.Ajax.SharePoint.dll

    I also referenced Telerik.Web.UI (C:\Windows\assembly\GAC_MSIL\Telerik.Web.UI\2014.3.1024.35__121fae78165ba3d4\Telerik.Web.UI.dll)

    When trying to build the project, I get this error and this warning :

    Error 3 The base class or interface 'Microsoft.SharePoint.WebPartPages.WebPart' in assembly 'Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c' referenced by type 'Telerik.Ajax.SharePoint.TelerikWebPart' could not be resolved c:\Windows\assembly\GAC_MSIL\Telerik.Ajax.SharePoint\2014.3.1024.35__aa9e5f693af67c7b\Telerik.Ajax.SharePoint.dll CrossSiteCollectionListViewer

    Warning 4 Reference to type 'Microsoft.SharePoint.WebPartPages.WebPart' claims it is defined in 'c:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v12.0\SharePointTools\ReferenceAssemblies\Microsoft.SharePoint.dll', but it could not be found c:\Windows\assembly\GAC_MSIL\Telerik.Ajax.SharePoint\2014.3.1024.35__aa9e5f693af67c7b\Telerik.Ajax.SharePoint.dll CrossSiteCollectionListViewer

    It seems like a version problem between the Microsoft assembly and the Telerik assembly but I am really not sure.  I installed SharePoint (ASP.NET AJAX) with the Telerik Control Panel but I can't find the dll somewhere else than in the GAC.

    Maybe someone can help me out here.

    Regards,

    Martin L. 
  2. Marin
    Admin
    Marin avatar
    1045 posts

    Posted 01 Dec 2014 Link to this post

    Hello,

    Which version of Sharepoint are you using? Normally the Microsoft.SharePoint.dll  assembly is defined in the C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\ISAPI\ folder on every server hosting a Sharepoint environment. Can you create a basic Sharepoint web part that does not reference the Telerik controls? This should also use the Microsoft.SharePoint.WebPartPages.WebPart base class and you can check where it references it from.
    You can also check whether you are referencing the correct Mircosoft.Sharepoint.dll assembly in your project.

    Regards,
    Marin
    Telerik
     
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
     

  3. Martin Lalonde
    Martin Lalonde avatar
    3 posts
    Member since:
    Jan 2010

    Posted 02 Dec 2014 in reply to Marin Link to this post

    Hi Marin,
    I'm using SharePoint 2010 and the assembly reference is at C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\ISAPI\ as expected.  When I create a basic SharePoint web part without referencing the Telerik control, it builds correctly. 

    Thanks
  4. Maria Ilieva
    Admin
    Maria Ilieva avatar
    4017 posts

    Posted 05 Dec 2014 Link to this post

    Hello,

    In this case the reason for the issue is that most probably a duplicate reference to the  assembly appears – one that points to the GAC and one that points to a file somewhere else on the machine.
    Check your project references, clear the ASP cache and verify if this makes any difference.

    Regards,
    Maria Ilieva
    Telerik
     
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
     
Back to Top