Common problems and solutions


Summary This topic lists some common issues that can occur when working with the Web Application Developer Framework (ADF). Error messages, potential solutions, and documentation links are provided where applicable.

In this topic


Map, Toc, and Overview Map do not display

Issue: When viewing a Web ADF application in a browser, the Map, Toc, and Overview Map do not display, and no error is returned.
Solution: There are varied reasons for this behavior. Check the following:
  • If working with ArcGIS Server local data sources, confirm that the Web application is running as a valid user account (identity). The user should be part of the agsusers or agsadmin group on the machine where the server object manager (SOM) is running. To define an identity in Visual Studio, use the Add ArcGIS Identity context menu on the Web project in the Solution Explorer. You can also define the identity in the web.config file for the Web application using the identity tag in <system.web> as follows:
    <identity impersonate="true" userName="mydomain\myuser" password="mypassword" />
     
For more information on ArcGIS identity, see the Project context menus and dialog boxes section in Visual Studio 2008/2010 integration.
  • If an identity has been defined for a Web application, confirm that it is correct.
  • If you're using Internet Explorer on Windows Server 2003, add the Web site as a trusted site.
  • In Visual Studio, open any resource manager control (for example, MapResourceManager) and check the server name, service name, and data frame name for ArcGIS Server resources. Confirm they are correct.
  • Confirm that the ArcGIS Server services being accessed by the Web ADF application are running.
  • If you're using Internet Explorer, the host name of the machine serving the Web application cannot contain an underscore character. Host names cannot contain underscore characters due to a limitation of Domain Name System (DNS) and Active Server Pages (ASP). The Microsoft Support Web site states that "Cookies on ASP pages are blocked if the server name contains characters that are not supported by Domain Name System (DNS). For example, you cannot use underscore characters (_) in the server name. This behavior is by design."
Link: Map image does not display in a .NET Web application

Web site cannot be configured with ASP.NET 2.0

Issue: When loading a Web application in Visual Studio 2005, you are prompted to convert from a previous version of ASP.NET to ASP.NET version 2.0. After clicking Yes, another message indicates that the site cannot be configured with ASP.NET 2.0.
Message: "The site <site url> is currently configured for use with ASP.NET <version>. Microsoft Visual Studio has been designed for use with ASP.NET 2.0; if not configured, some features may make incorrect assumptions, and pages designed with the tool may not render correctly. Would you like the site to be configured for use with ASP.NET 2.0?"
Solution: The Web ADF for the .NET Framework requires the .NET 2.0 Framework and ASP.NET 2.0. This issue indicates that IIS is configured to use a version of ASP.NET prior to 2.0 by default. To configure ASP.NET 2.0 with IIS, perform the following steps and reload the Web application in Visual Studio 2005:
  1. Install Microsoft .NET Framework version 2.0.
  2. Open a command prompt and navigate to c:\<windows systemfolder>\Microsoft.NET\Framework\v2.0.50727.
  3. Run the command: aspnet_regiis -i. This registers ASP.NET 2.0 as the default version with IIS.
  4. Run the command: iisreset. This restarts the IIS server to finalize the registration process.

IIS Admin service terminates

Issue: When starting IIS Web services, a generic error is returned and the service fails to start. The event viewer records the error listed in the Message section.
Message: "The IIS Admin service terminated with service-specific error 2148073487 (0x8009000F)."
Solution: Perform the following steps or follow the steps from the Link section.
  1. Uninstall IIS.
  2. In Windows Explorer, navigate to C:\Documents and Settings\All Users\Application Data\Microsoft\Crypto\RSA.
  3. Rename the MachineKeys folder to OldMachineKeys and delete all other folders.
  4. Reinstall IIS.
  5. Open a Visual Studio 2005 command prompt and type: aspnet_regiis -i.
Link: System Errors When You Open World Wide Publishing Service or Administrative Tools Services

Unable to debug ASP.NET applications

Issue: When attempting to debug an ASP.NET application, an error is returned indicating that debugging cannot be started on the Web server and a server application error occurred. When attempting to view the default home page for IIS, or a .aspx page in a browser, an HTTP 500 code is returned. Other notable issues include the following:
  • Errors in the event log associated with the IIS server (W3SVC) referencing the message "Class not registered" or "Specified metadata was not found"
  • Unable to view COM+ applications in the Component Services dialog box
  • Three IIS COM+ applications are not listed in the Component Services dialog box
To view COM+ applications on Windows XP, go to Start>Control Panel>Administrative Tools>Component Services to open the Component Services dialog box. Then navigate to Console Root>Component Services>My Computer>COM+ Applications. Visual Studio 2005 returns the error listed in the Message section.
Message: "Unable to start debugging on the Web server. <html><head><title>Server Application Error</title></head><body><h1>Server Application Error</h1> The server has encountered an error while loading an application during the processing of your request. Please refer to the event log for more information. Please contact the server administrator for assistance.</body></html> Make sure the server is operating correctly. Verify there are no syntax errors in web.config by doing a Debug.Start Without Debugging. You may also want to refer to the ASP.NET and ATL Server debugging topic in the online documentation."
Solution: If reinstalling IIS and the .NET Framework does not solve the problem, perform the following steps:
  1. Open a Visual Studio 2005 command prompt (preferred) or a command prompt with the .NET Framework root folder (that is, C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727) in the path.
  2. Navigate to %windir%\system32\inetsrv.
  3. To reinstall the Distributed Transaction Coordinator, run the command: msdtc -install.
  4. Open the Services dialog box (on Windows XP, Start>Control Panel>Administrative Tools>Services), set the Distributed Transaction Coordinator service startup type to Automatic, and start the service.
  5. To recreate the COM+ IIS packages, in the command prompt window, type: rundll32 wamreg.dll, CreateIISPackage.
  6. To register ASP (not ASP.NET) with IIS, type: regsvr32 asptxn.dll. A dialog box indicates whether registration was successful.
  7. To restart IIS and recognize the changes, type: iisreset.
Link: How To Troubleshoot ASP in IIS 5.0

Broken Map control image link

Issue: The Map control shows a broken image link at run time in a browser.
Solution: Two properties on the Map control determine how a map image is generated and sent to the client browser. The UseMimeData property determines whether the Map control generates an output image on the server or streams the output image to the client. If UseMimeData is true, the Map control streams the output image to the client browser using a custom Hypertext Transfer Protocol (HTTP) handler.
If UseMimeData is false, the Map control generates an output image on the server and stores it on disk. Then the uniform resource locator (URL) to the output image is sent to the client to be rendered. If UseMimeData is false, the VirtualDirectory property must be set to a virtual directory on the Web server. The virtual directory must be a valid directory from the perspective of the Web server root or current application directory. For example, the virtual directory http://localhost/output is referenced in the VirtualDirectory property as /output. If the virtual directory is in the Web application root folder, the initial forward slash is not required. For example, the Web application MyWebApp contains a directory named images. The full URL is: http://localhost/MyWebApp/images. If MyWebApp contains a page with a Map control, the VirtualDirectory property can reference the images directory as images.

Web application cannot access library

Issue: A Web application has been created with a toolbar that accesses functionality in a custom class library. When loading in a browser, the Web application is unable to access the library.
Message: "Server Error in '/<Web App Folder>' Application. Could not load file or assembly '<custom class library name>' or one of its dependencies. Access is denied."
Solution: The following solutions are available:
  • Disable the Microsoft Indexing Service. If the service is required, remove the temporary ASP.NET files from the folders that the index server scans. See the document reference in the Link section for more information.
  • Set permissions on the directory that contains the custom class library (.dll) to provide read and execute privileges to the user running the Web application. When adding a class library project as a reference to a Web site project, the class library project output (a .dll file) is copied to the Bin folder in the Web application root directory.
Link: PRB: Access Denied Error When You Make Code Modifications with Index Services Running

Assembly and class name are not displayed

Issue: When setting the ServerActionAssembly or ServerActionClass property for a custom tool in a Web ADF Toolbar control, the assembly and class name are not displayed in the drop-down list.
Message: "Could not find any resource appropriate for the specified culture or the neutral culture. Make sure 'ESRI.ArcGIS.ADF.Web.UI.Design.resources' was correctly embedded or linked into assembly 'ESRI.ArcGIS.ADF.UI.WebControls' at compile time, or that all the satellite assemblies required are loadable and fully signed."
Solution: The Web ADF uses reflection to discover available assemblies and class names that support the IServerActionTool interface. The Web application must have access to the assembly containing the code for the custom tool. When you build the class library, put it in a location the Web application can find. If a class library project has been added as a reference to the Web project, build the class library project first (the built assembly is placed in the Bin folder under the Web site root), then set properties on the tool.

Absolute positioning of Web controls

Issue: When adding controls to a Web page in design time, they are added in flow layout. How can this be changed?
Solution: By default, the position of controls added in Visual Studio 2005 at design time is not set. As a result, the controls are permitted to flow from left to right within a line, and from top to bottom within the page. To use absolute positioning as the default, which enables you to place controls at precise positions on the Design view surface, perform the following steps:
  1. Choose Layout>Position>Auto-Position Options.
  2. Under the HTML Designer category, choose CSS Positioning.
  3. Check the top option for changing position when dragging and dropping controls and select Absolutely Positioned from the drop-down list.
  4. Click OK to close the dialog box.
Controls added to new Web applications will use absolute positioning. When added, they will snap to the 0, 0 coordinate in the upper left corner but can be selected and dragged to the desired location on the page.

Web ADF controls not available in Visual Studio toolbox

Issue: In Visual Studio 2005, the Web ADF controls are not available in the Visual Studio toolbox.
Solution: This issue is encountered when working with Visual Studio Web Express. To add the Web ADF controls to the Visual Studio toolbar, perform the following steps:
  1. Right-click the toolbar, select Add Tab, and type a name for the new tab. For example, ArcGIS Web Controls.
  2. Right-click the new tab and select Choose Items. The Choose Items dialog box opens.
  3. Click the Browse button, navigate to the location of the ESRI.ArcGIS.ADF.Web.UI.WebControls.dll, and click Open. A set of Web ADF controls is added to and selected in the Choose Items dialog box.
  4. Check the box next to one of the items and all selected items are also checked.
  5. Click OK. The new tab contains the Web ADF controls.

ScriptManager error

Issue: After adding a ScriptManager to a Web ADF application created with ArcGIS Server 9.2, the error messages shown in the Message section are returned at run time.
Message: The following error messages are displayed depending on your framework:
  • JavaScript—"'Sys' is undefined"
  • ASP.NET—"The ScriptManager is required to appear on the page before…"
Solution: Enable ASP.NET AJAX for use in the Web application. For more information, see AJAX capabilities in the Web ADF.

Serialization

Issue: The session management options StateServer and SQLServer do not function when using a non-pooled map service via an ArcGIS Server local map resource in a Web ADF application.
Message: ASP.NET: "Unable to serialize the session state. In 'StateServer' and 'SQLServer' mode, ASP.NET will serialize the session state objects, and as a result non-serializable objects or MarshalByRef objects are not permitted."
Solution: Use InProc, the default session state management mode. InProc mode permits storage of an entire object in session without serialization. The other modes (StateServer and SQLServer) require that an object be .NET serializable. Working with a non-pooled service via an ArcGIS Server local resource requires the use of ArcObjects Component Object Model (COM) types. Since COM types are not .NET serializable, advanced session management stores that require .NET serialization cannot be utilized.

AppROT and Windows Vista

Issue: If you are writing code that accesses the application running an object table (AppROT), be aware that your application running on Windows Vista fails if it does not have a high enough permission level.
Solution:  AppROT is used as a global list of all currently running ESRI ArcGIS applications. Calls made in to AppROT are out-of-process Component Object Model (COM) calls in to the AppROT.exe COM server. If in your development you are making calls in to AppROT, be aware of permission level restrictions on Windows Vista.

On Windows Vista, if the AppROT executable is run using administrator privileges, client applications running with reduced privileges will not cocreate an AppROT object due to increased security—the call in to AppROT hangs for 30 seconds, then fails.
To ensure your application runs correctly, one possible solution is to use an application manifest. For more information, see Step 6: Create and Embed an Application Manifest (UAC) on the Microsoft Developer Network (MSDN) Web site.