laptop and a wrench

Bug

The IFeatureSelection.SelectFeatures Method throws (RPC_E_SERVERFAULT ) exceptions when called with a query filter on an ArcMap dataset from an external Windows Forms application

Last Published: December 22, 2016 ArcObjects SDK
Bug ID Number BUG-000096943
SubmittedJune 7, 2016
Last ModifiedJune 5, 2024
Applies toArcObjects SDK
Version found10.4
Operating SystemWindows OS
Operating System Version7.0 64 Bit
StatusWill Not Be Addressed

Additional Information

We apologize that we were unable to address this issue within the current product support cycle. If the issue continues to affect your work in a supported release, please contact Technical Support.

Workaround

Use the IObjectFactory ArcObjects to get around the problem:C# Code:[STAThread()] static void Main(string[] args) { //ESRI License Initializer generated code. m_AOLicenseInitializer.InitializeApplication(new esriLicenseProductCode[] { esriLicenseProductCode.esriLicenseProductCodeBasic, esriLicenseProductCode.esriLicenseProductCodeStandard, esriLicenseProductCode.esriLicenseProductCodeAdvanced }, new esriLicenseExtensionCode[] { }); //ESRI License Initializer generated code. IAppROT pROT = new AppROT(); int itmCnt = 0; IApplication pAPP = null; while (itmCnt < pROT.Count) { pAPP = pROT.Item[itmCnt]; if (<a href="http://pAPP.Name" target="_blank">pAPP.Name</a> == "ArcMap") break; itmCnt++; } IMxDocument pMX = pAPP.Document as IMxDocument; IFeatureLayer pFL = pMX.FocusMap.Layer[0] as IFeatureLayer; IFeatureSelection pFSel = pFL as IFeatureSelection; ///TestConsole application space IQueryFilter pQF = new QueryFilter(); /// appRot application space IObjectFactory objectFactory = (IObjectFactory)pAPP; IPersist persist = (IPersist)pQF; System.Guid typeClassID; persist.GetClassID(out typeClassID); pQF = (IQueryFilter)objectFactory.Create(typeClassID.ToString("B")); pQF.WhereClause = "1=1"; IFeatureClass FC = pFL.FeatureClass; IFeatureCursor pFeatCursor = FC.Search(pQF, false); //pFSel.SelectionSet.Select(pQF, esriSelectionType.esriSelectionTypeHybrid, esriSelectionOption.esriSelectionOptionNormal, ((IDataset)pFL.FeatureClass).Workspace); pFSel.SelectFeatures(pQF, esriSelectionResultEnum.esriSelectionResultNew, true); //Do not make any call to ArcObjects after ShutDownApplication() }

Steps to Reproduce

Bug ID: BUG-000096943

Software:

  • ArcObjects SDK

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