This is a migrated thread and some comments may be shown as answers.

When inheriting from class TelerikSPRadGridWebPart I get reference error

3 Answers 30 Views
WebParts for SharePoint
This is a migrated thread and some comments may be shown as answers.
Martin Lalonde
Top achievements
Rank 1
Martin Lalonde asked on 26 Nov 2014, 06:21 PM
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. 

3 Answers, 1 is accepted

Sort by
0
Marin
Telerik team
answered on 01 Dec 2014, 09:58 AM
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.
 
0
Martin Lalonde
Top achievements
Rank 1
answered on 02 Dec 2014, 01:41 PM
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
0
Maria Ilieva
Telerik team
answered on 05 Dec 2014, 12:38 PM
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.
 
Tags
WebParts for SharePoint
Asked by
Martin Lalonde
Top achievements
Rank 1
Answers by
Marin
Telerik team
Martin Lalonde
Top achievements
Rank 1
Maria Ilieva
Telerik team
Share this question
or