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

Ambiguous match exception when AjaxControlToolkit controls used with ASP.Net AJAX Telerik controls

1 Answer 136 Views
ScriptManager and StyleSheetManager
This is a migrated thread and some comments may be shown as answers.
pulak
Top achievements
Rank 1
pulak asked on 24 Dec 2010, 12:07 PM
I have a web application (framework 3.5) that uses AjaxControlToolkit v 3.5.40412.2  along with  Telerik.Web.UI.dll v 2010.3.1215.35

In the master page I use have AjaxControlToolkit ScriptManager with all the script references as below.

<ajaxToolKit:ToolkitScriptManager ID="ScriptManager1" runat="server" EnablePageMethods="true" EnablePartialRendering="true">
            <Services>
                <asp:ServiceReference Path="~/Services/PopulateUnitsWebServices.asmx" />
            </Services>
             <Services>
                <asp:ServiceReference Path="~/Services/VolunteerDataService.asmx"/>
            </Services>
            <Scripts>
            <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.Core.js" />
            <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQuery.js" />
            <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQueryInclude.js" />
            </Scripts>
        </ajaxToolKit:ToolkitScriptManager>  
        <telerik:RadStyleSheetManager id="RadStyleSheetManager1" runat="server" />
        <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel" runat="server" Transparency="30" CssClass="LoadingPanel_Hay"></telerik:RadAjaxLoadingPanel>       
       <telerik:RadSkinManager ID="RadSkinManager1" Runat="server" Skin="Windows7">
    </telerik:RadSkinManager>

In my webpage where i use controls from both Telerik.Web.UI and AjaxControlToolkit I use the RadAjaxManager as below.

<telerik:RadAjaxManager runat="server" ID="radAjax" DefaultLoadingPanelID="RadAjaxLoadingPanel">
           <AjaxSettings>
               <telerik:AjaxSetting AjaxControlID="AvailableDonors">
                   <UpdatedControls>
                       <telerik:AjaxUpdatedControl ControlID="AvailableDonors" />
                       <telerik:AjaxUpdatedControl ControlID="SelectedDonors" />   
                       <telerik:AjaxUpdatedControl ControlID="hdnRatingAndCommentSpace" />
                   </UpdatedControls>
               </telerik:AjaxSetting>
               <telerik:AjaxSetting AjaxControlID="SelectedDonors">
                   <UpdatedControls>
                       <telerik:AjaxUpdatedControl ControlID="AvailableDonors" />
                       <telerik:AjaxUpdatedControl ControlID="SelectedDonors" />
                       <telerik:AjaxUpdatedControl ControlID="hdnRatingAndCommentSpace" />
                   </UpdatedControls>
               </telerik:AjaxSetting>
           </AjaxSettings>
       </telerik:RadAjaxManager>

When I debug the application locally the code runs perfectly. However when I publish this site on IIS (v7 or v6) on application server I get the following Ambiguous match exception. I get the same exception when I publish the site on my local machine and run the Precompiled code.

• Ambiguous match found.
(System.Reflection.AmbiguousMatchException)
at System.RuntimeType.GetField(String name, BindingFlags bindingAttr) 
at System.Web.UI.Util.GetNonPrivateFieldType(Type classType, String fieldName) 
at System.Web.Compilation.BaseTemplateCodeDomTreeGenerator.BuildFieldDeclaration(ControlBuilder builder) 
at System.Web.Compilation.BaseTemplateCodeDomTreeGenerator.BuildSourceDataTreeFromBuilder(ControlBuilder builder, Boolean fInTemplate, Boolean topLevelControlInTemplate, PropertyEntry pse) 
at System.Web.Compilation.BaseTemplateCodeDomTreeGenerator.BuildSourceDataTreeFromBuilder(ControlBuilder builder, Boolean fInTemplate, Boolean topLevelControlInTemplate, PropertyEntry pse) 
at System.Web.Compilation.BaseTemplateCodeDomTreeGenerator.BuildSourceDataTreeFromBuilder(ControlBuilder builder, Boolean fInTemplate, Boolean topLevelControlInTemplate, PropertyEntry pse) 
at System.Web.Compilation.BaseTemplateCodeDomTreeGenerator.BuildSourceDataTreeFromBuilder(ControlBuilder builder, Boolean fInTemplate, Boolean topLevelControlInTemplate, PropertyEntry pse) 
at System.Web.Compilation.BaseTemplateCodeDomTreeGenerator.BuildSourceDataTreeFromBuilder(ControlBuilder builder, Boolean fInTemplate, Boolean topLevelControlInTemplate, PropertyEntry pse) 
at System.Web.Compilation.BaseTemplateCodeDomTreeGenerator.BuildSourceDataTreeFromBuilder(ControlBuilder builder, Boolean fInTemplate, Boolean topLevelControlInTemplate, PropertyEntry pse) 
at System.Web.Compilation.BaseTemplateCodeDomTreeGenerator.BuildSourceDataTreeFromBuilder(ControlBuilder builder, Boolean fInTemplate, Boolean topLevelControlInTemplate, PropertyEntry pse) 
at System.Web.Compilation.BaseTemplateCodeDomTreeGenerator.BuildSourceDataTreeFromBuilder(ControlBuilder builder, Boolean fInTemplate, Boolean topLevelControlInTemplate, PropertyEntry pse) 
at System.Web.Compilation.TemplateControlCodeDomTreeGenerator.BuildMiscClassMembers() 
at System.Web.Compilation.PageCodeDomTreeGenerator.BuildMiscClassMembers() 
at System.Web.Compilation.BaseCodeDomTreeGenerator.BuildSourceDataTree() 
at System.Web.Compilation.BaseCodeDomTreeGenerator.GetCodeDomTree(CodeDomProvider codeDomProvider, StringResourceBuilder stringResourceBuilder, VirtualPath virtualPath) 
at System.Web.Compilation.BaseTemplateBuildProvider.GenerateCode(AssemblyBuilder assemblyBuilder) 
at System.Web.Compilation.AssemblyBuilder.AddBuildProvider(BuildProvider buildProvider)
  
• Ambiguous match found.
(System.Web.HttpParseException)
at System.Web.Compilation.AssemblyBuilder.AddBuildProvider(BuildProvider buildProvider) 
at System.Web.Compilation.BuildProvidersCompiler.ProcessBuildProviders() 
at System.Web.Compilation.BuildProvidersCompiler.PerformBuild() 
at System.Web.Compilation.BuildManager.CompileWebFile(VirtualPath virtualPath) 
at System.Web.Compilation.BuildManager.GetVPathBuildResultInternal(VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile) 
at System.Web.Compilation.BuildManager.GetVPathBuildResultWithNoAssert(HttpContext context, VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile) 
at System.Web.Compilation.BuildManager.GetVirtualPathObjectFactory(VirtualPath virtualPath, HttpContext context, Boolean allowCrossApp, Boolean noAssert) 
at System.Web.Compilation.BuildManager.CreateInstanceFromVirtualPath(VirtualPath virtualPath, Type requiredBaseType, HttpContext context, Boolean allowCrossApp, Boolean noAssert) 
at System.Web.UI.PageHandlerFactory.GetHandlerHelper(HttpContext context, String requestType, VirtualPath virtualPath, String physicalPath) 
at System.Web.UI.PageHandlerFactory.System.Web.IHttpHandlerFactory2.GetHandler(HttpContext context, String requestType, VirtualPath virtualPath, String physicalPath) 
at System.Web.HttpApplication.MapHttpHandler(HttpContext context, String requestType, VirtualPath path, String pathTranslated, Boolean useAppConfig) 
at System.Web.HttpApplication.MapHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() 
at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)

I have also tried using the RadScriptManager instead of AjaxToolkitScriptManager but with the same exception. I also installed Telerik assembly to the GAC but again with the same results.  I also removed the RadAjaxManager from my webpage but got the same exception.

Thanks for all your help.
Pulak

1 Answer, 1 is accepted

Sort by
0
Simon
Telerik team
answered on 04 Jan 2011, 12:40 PM
Hello pulak,

Judging by the stack traces the exception originates in the .NET Framework's code.

Please see this blog post dwelling on the same issue for a solution.

In any case, could you please try using the standard ScriptManager to see whether the issue still occurs with it?

Best wishes,
Simon
the Telerik team
Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
Tags
ScriptManager and StyleSheetManager
Asked by
pulak
Top achievements
Rank 1
Answers by
Simon
Telerik team
Share this question
or