olamr

System.AccessViolationException using C#

Discussion created by olamr on Jun 5, 2012
Latest reply on Jun 7, 2012 by olamr
Hi all,
I am developing a toolbar for ArcMap with C#, which can import features from external geodatabases.
For each feature to import, receiving featureclass is searched for existing values using objectid and cursors. (Cursors are closed using "Marshal.ReleaseComObject(cur);" after use.)
and the feature is inserted if needed.
This seems to work well as long as the receiving featureclass holds a small number of features, but when the number grows (ex. 100.000), I get a System.AccessViolationException after e few hundred inserts.
It looks as if the exception is thrown during FeatureClass.CreateFeature. But it is difficult to examine in the debugger, since it looks as if there is no specific number of inserts before the crash occurs.

Using GDB file geodatabase for storage.
ArcMap 10.0 SP3
VisualStudio 2010 SP1
Win7-64

Have a missed some limitations here? Any known bugs?

TIA
Ola

Outcomes