Understanding the Error
The error message “The base class includes the field {FieldName}, but its type (Telerik.Web.UI.RadGrid) is not compatible with the type of control (Telerik.Web.UI.RadGrid)” appears paradoxical — both types have the same name. The key is that .NET considers types from different assembly versions as completely different types, even when they have the same fully qualified name.
This error occurs in ASP.NET Web Forms applications (including SharePoint web parts) when:
- The
.aspxor.ascxfile references one version of the Telerik assembly - The code-behind or designer file references a different version
- The runtime loads a version that does not match what the page markup expects
The full error typically looks like:
The base class includes the field 'RadGrid1', but its type
(Telerik.Web.UI.RadGrid) is not compatible with the type of control
(Telerik.Web.UI.RadGrid).
Root Cause: Assembly Version Mismatch
In .NET, a type’s identity includes its assembly name and version. This means:
Telerik.Web.UI.RadGridfromTelerik.Web.UI, Version=2010.3.1317.35is a different type thanTelerik.Web.UI.RadGridfromTelerik.Web.UI, Version=2011.1.315.40
When ASP.NET compiles a page, it links the controls in the markup to the types defined by the @Register directive. If the designer file (.designer.cs) was generated against version A but the runtime resolves to version B, the types do not match.
Common Scenarios
1. Upgrading Telerik Controls
You update the Telerik NuGet package or replace the DLLs in the bin folder, but the .aspx files still contain @Register directives pointing to the old version.
2. GAC vs Bin Folder Conflict
The Telerik assembly is installed in the Global Assembly Cache (GAC) at one version, while the bin folder contains a different version. ASP.NET resolves assemblies from the GAC first, creating a mismatch.
3. SharePoint Deployments
In SharePoint, Telerik assemblies are often deployed to the GAC via solution packages. If multiple solutions deploy different versions, or a solution is retracted without cleaning up the GAC, you get version conflicts.
4. Multiple Projects in a Solution
Different projects reference different Telerik versions, and the build process copies inconsistent DLLs to the output directory.
Fix 1: Update All @Register Directives
Check every .aspx and .ascx file that uses Telerik controls. The @Register directive at the top of the file specifies the assembly version:
<%-- Old version reference - causes the error --%>
<%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI"
Assembly="Telerik.Web.UI, Version=2010.3.1317.35, Culture=neutral, PublicKeyToken=121fae78165ba3d4" %>
Update it to match the version of the DLL you have installed:
<%-- Updated to match the installed version --%>
<%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI"
Assembly="Telerik.Web.UI, Version=2011.1.315.40, Culture=neutral, PublicKeyToken=121fae78165ba3d4" %>
Or make it version-agnostic by removing the version information:
<%-- Version-agnostic reference (recommended) --%>
<%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI"
Assembly="Telerik.Web.UI" %>
Fix 2: Add Binding Redirects in web.config
Assembly binding redirects tell the .NET runtime to load a specific assembly version regardless of what version is requested. This is the most robust solution for handling version mismatches:
<configuration>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="Telerik.Web.UI"
publicKeyToken="121fae78165ba3d4"
culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-2024.1.0.0"
newVersion="2011.1.315.40" />
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>
The oldVersion range should cover all versions that might be referenced anywhere in the project. The newVersion must match the exact version of the Telerik DLL in your bin folder or GAC.
To find the exact version of your installed Telerik assembly:
# Check the version of the Telerik DLL in the bin folder
[System.Reflection.AssemblyName]::GetAssemblyName("C:\inetpub\wwwroot\MyApp\bin\Telerik.Web.UI.dll").Version
# Check what's in the GAC
gacutil /l "Telerik.Web.UI"
Fix 3: Clean the Bin Folder
Old DLLs left in the bin folder after an upgrade can cause conflicts:
- Close Visual Studio
- Delete all files in the
binfolder of your web application - Delete the
objfolder entirely - Reopen the solution in Visual Studio
- Clean the solution (Build > Clean Solution)
- Rebuild the solution (Build > Rebuild Solution)
This forces Visual Studio to copy fresh DLLs from the referenced packages or project references.
In a deployment scenario:
# Stop IIS, clean bin, restart
Stop-Service -Name W3SVC
Remove-Item -Path "C:\inetpub\wwwroot\MyApp\bin\Telerik.Web.UI.*" -Force
# Deploy the correct version
Copy-Item -Path "C:\Deploy\Telerik.Web.UI.dll" -Destination "C:\inetpub\wwwroot\MyApp\bin\"
Start-Service -Name W3SVC
Fix 4: Clean the GAC
If Telerik assemblies were previously installed in the Global Assembly Cache, they may conflict with the bin folder version.
Check What Is in the GAC
gacutil /l "Telerik.Web.UI"
Remove Old Versions from the GAC
gacutil /u "Telerik.Web.UI, Version=2010.3.1317.35, Culture=neutral, PublicKeyToken=121fae78165ba3d4"
For SharePoint Environments
In SharePoint, assemblies deployed via solution packages are typically placed in the GAC. Use the SharePoint Management Shell:
# List all installed solutions
Get-SPSolution | Where-Object { $_.Name -like "*telerik*" }
# Retract and remove the old solution
Uninstall-SPSolution -Identity "telerik-solution.wsp" -AllWebApplications
Remove-SPSolution -Identity "telerik-solution.wsp"
Then deploy the updated solution:
Add-SPSolution -LiteralPath "C:\Deploy\telerik-solution-new.wsp"
Install-SPSolution -Identity "telerik-solution-new.wsp" -GACDeployment -AllWebApplications
Fix 5: Regenerate Designer Files
After updating assembly references, the .designer.cs files may still reference the old types. Force Visual Studio to regenerate them:
- Open the
.aspxfile in Visual Studio - Switch to Design view and back to Source view
- Right-click the
.aspxfile in Solution Explorer and select Convert to Web Application (this regenerates the designer file)
Or delete the designer file and let Visual Studio recreate it:
- In Solution Explorer, expand the
.aspxfile - Delete the
.aspx.designer.csfile - Right-click the
.aspxfile and select Convert to Web Application
Telerik Version Management Best Practices
Use NuGet for Version Control
Using the Telerik NuGet feed ensures consistent versioning:
Install-Package Telerik.UI.for.AspNet.Ajax -Version 2024.1.0
Pin Versions Across Projects
In solutions with multiple projects, use a Directory.Build.props file or a central package management approach to ensure all projects reference the same Telerik version.
Upgrade Checklist
When upgrading Telerik controls in an ASP.NET project:
- Back up the project before upgrading
- Update the NuGet package or replace DLLs in all projects
- Search all
.aspx,.ascx, and.masterfiles for old version numbers in@Registerdirectives - Update
web.configbinding redirects - Clean the bin and obj folders
- Rebuild the entire solution
- Check the GAC for conflicting versions
- Test all pages that use Telerik controls
To find all files with old version references:
# Search for old Telerik version references across all ASPX files
Get-ChildItem -Path "C:\Projects\MyApp" -Include "*.aspx","*.ascx","*.master" -Recurse |
Select-String -Pattern "Version=2010.3.1317" |
Select-Object Path, LineNumber, Line
Use Version-Agnostic References
Wherever possible, remove version-specific information from @Register directives and rely on binding redirects in web.config to resolve the correct version. This decouples your page markup from specific assembly versions and makes future upgrades easier.
Summary
The Telerik “base class includes the field but its type is not compatible” error is caused by multiple versions of the Telerik.Web.UI assembly being referenced within the same project. Fix it by updating all @Register directives to match the installed version (or making them version-agnostic), adding binding redirects in web.config, cleaning old DLLs from the bin folder and GAC, and rebuilding the project to regenerate designer files. For ongoing maintenance, use NuGet to manage Telerik versions and always update all references simultaneously during upgrades.