laptop and a wrench

Bug

Resource type implementation specified in ESRI.ArcGIS.ADF.Web.DataSources.ArcGISServer.Local.config is ignored by .NET Web ADF.

Last Published: August 25, 2014 No Product Found
Bug ID Number NIM045843
SubmittedJune 9, 2009
Last ModifiedApril 2, 2025
Applies toNo Product Found
Version found9.3.1
Program languageC#
Version FixedN/A
StatusFixed

Workaround

The workaround (see below) is to derive from GISDataSourceLocal and override CreateResource. In the datasource config file, they would have to point to their custom datasource implementation instead of GISDataSourceLocal. public override IGISResource CreateResource(ResourceInfo resourceInfo, string name) { IGISResource resource = null; switch (resourceInfo.Type) { case ResourceType.Map: if (ImageResourceBase.IsImageResourceDefinition(resourceInfo.ResourceDefinition)) { IMapResource mapResource = new ImageResourceLocal(name, this); mapResource.ResourceDefinition = resourceInfo.ResourceDefinition; resource = mapResource; } else { IMapResource mapResource = new MyMapResourceLocal(name, this); <== Use custom map resource implementation here mapResource.ResourceDefinition = resourceInfo.ResourceDefinition; resource = mapResource; } break; case ResourceType.Geocode: IGeocodeResource gcResource = new GeocodeResourceLocal(name, this); gcResource.ResourceDefinition = resourceInfo.ResourceDefinition; resource = gcResource; break; case ResourceType.Geoprocessing: IGeoprocessingResource gpResource = new GeoprocessingResourceLocal(name, this); gpResource.ResourceDefinition = resourceInfo.ResourceDefinition; resource = gpResource; break; } return resource; } Then, public class myMapResourceLocal:MapResourceLocal { public myMapResourceLocal() : base() { // create a writer and open the file TextWriter tw = new StreamWriter(@"C:\temp\m_gisresourcelocal\date.txt"); // write a line of text to the file tw.WriteLine(DateTime.Now); // close the stream tw.Close(); } public myMapResourceLocal(string name, GISDataSourceLocal service) : base(name, service) { // create a writer and open the file TextWriter tw = new StreamWriter(@"C:\temp\m_gisresourcelocal\date.txt"); // write a line of text to the file tw.WriteLine(DateTime.Now); // close the stream tw.Close(); } }

Steps to Reproduce

Bug ID: NIM045843

Software:

  • No Product Found

Get notified when the status of a bug changes

Download the Esri Support App

Discover more on this topic

Get help from ArcGIS experts

Contact technical support

Download the Esri Support App

Go to download options