English

Error: ESRI.ArcGIS.ADF.Web.UI.WebControls.BuddyControlCollection must have items of type ESRI.ArcGIS.ADF.Web.UI.WebControls.BuddyControl

Error Message

After installing version 9.3 of the ArcGIS Server .NET Web ADF and modifying a Web application created with version 9.2, building the Web site in Visual Studio can return one of the following errors:

Message # 1

"ESRI.ArcGIS.ADF.Web.UI.WebControls.BuddyControlCollection
must have items of type
'ESRI.ArcGIS.ADF.Web.UI.WebControls.BuddyControl'.
'esri.arcgis.adf.web.ui.webcontrols.buddycontrol' is of type
'System.Web.UI.HtmlControls.HtmlGenericControl'."

Message # 2

"ESRI.ArcGIS.ADF.Web.UI.WebControls.GISResourceItemCollection`1
[[ESRI.ArcGIS.ADF.Web.UI.WebControls.MapResourceItem,
ESRI.ArcGIS.ADF.Web.UI.WebControls, Version=9.3.0.1770,
Culture=neutral, PublicKeyToken=8fc3cc631e44ad86]]
must have items of type
'ESRI.ArcGIS.ADF.Web.UI.WebControls.MapResourceItem'.
'esri.arcgis.adf.web.ui.webcontrols.mapresourceitem' is of type
'System.Web.UI.HtmlControls.HtmlGenericControl'."

Error message #2 is specific to the MapResourceManager. The GeoprocessingResourceManager and GeocodeResourceManager controls return slightly different messages that refer to 'GeoprocessingResourceItem' and 'GeocodeResourceItem' respectively.

Cause

The problem occurs because the web.config file of the application contains references to version 9.2 Web ADF and ArcObjects assemblies, but the installed versions of these assemblies are version 9.3. Though publisher policy files are in place to direct applications created with the ArcGIS Server 9.2 Web ADF to use the newer version 9.3 assemblies, Visual Studio does not respect this due to a bug.

Visual Studio Designer not Respecting Assembly Binding Redirection.

When editing a property for a Web ADF control, incorrect markup gets inserted into the page, causing these errors. The incorrect markup can be found by looking at the source code view of the ASPX page.

The problem only happens when editing a control that contains child elements. Examples of controls that use child elements are the MapResourceManager, Search or Query tasks, and the Toolbar.

Solution or Workaround

If there are version 9.2-based Web ADF applications that need to be used with version 9.3, before editing anything in the project, update the assembly version numbers referenced in the Web application to 9.3.0.1770.

The following steps describe how to update the applications to version 9.3.0.1770 as well as how to fix the incorrect markup.

  1. Update the assembly version numbers referenced in the Web application to 9.3.0.1770.

    a) Select Edit > Find and Replace > Find in Files and configure the dialog as seen below.
    b) Select to replace all of the occurrences of version 9.2.x.x with 9.3.0.1770 in the solution. The regular expression can be copied from below:

    9.2.[0-9].[0-9][0-9][0-9][0-9]
    [O-Image] Find And Replace dialog
  2. Fix the corrupted markup in the ASPX files.

    a) Right-click the ASPX file in the Solution Explorer. Select View Markup.

    b) Depending on the control that was modified, replace the following strings with the correct values.

    Tasks

    If the Search Attributes, Query Attributes, Geoprocessing, Find Address, or Find Place task was modified, correct the following string.

    Find:

    Code:
    ESRI.ArcGIS.ADF.Web.UI.WebControls.BuddyControlCollection

    Replace with:

    Code:
    esri:buddycontrol

    Toolbar

    If the Toolbar control was modified, correct the following two strings.

    Find:

    Code:
    esri.arcgis.adf.web.ui.webcontrols.tool

    Replace with:

    Code:
    esri:tool


    Find:

    Code:
    esri.arcgis.adf.web.ui.webcontrols.buddycontrol

    Replace with:

    Code:
    esri:buddycontrol

    MapResourceManager

    If the MapResourceManager was modified, correct the following string.

    Find:

    Code:
    esri.arcgis.adf.web.ui.webcontrols.mapresourceitem

    Replace with:

    Code:
    esri:mapresourceitem

    GeocodeResourceManager

    If the GeocodeResourceManager was modified, correct the following string.

    Find:

    Code:
    esri.arcgis.adf.web.ui.webcontrols.geocoderesourceitem

    Replace with:

    Code:
    esri:geocoderesourceitem

    GeoprocessingResourceManager

    If the GeoprocessingResourceManager was modified, correct the following string.

    Find:

    Code:
    esri.arcgis.adf.web.ui.webcontrols.geoprocessingresourceitem

    Replace with:

    Code:
    esri:geoprocessingresourceitem

Related Information