laptop and a wrench

Bogue

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

Dernière publication: August 25, 2014 No Product Found
Numéro d’ID de bogue NIM045843
EnvoiJune 9, 2009
Dernière modificationApril 2, 2025
S’applique àNo Product Found
Version trouvée9.3.1
Langue du programmeC#
Version de correctionN/A
StatutFixed

Solution de contournement

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(); } }

Étapes pour reproduire

ID de bogue: NIM045843

Logiciel:

  • No Product Found

Recevoir une notification lorsque le statut d’un bogue change

Télécharger l’application Esri Support

En savoir plus sur ce sujet

Obtenir de l’aide auprès des experts ArcGIS

Contacter le support technique

Télécharger l’application Esri Support

Accéder aux options de téléchargement