As stated above, I seem to be running into an issue when I am unable to Add a layer to my map because the file is in use elsewhere. What I am doing before adding the layer is generating a RecordID using the built in function to do so from ShapefileFeatureLayer. As soon as I implemented a check system to see if the field exists and if not to create it, I started receiving this error.
I am unsure if the record ID is still being generated or what the case may be but I am wondering how to check the layer to see if it is in use by another process and handle it from there. It did not immediately seem to to be built into the methods and properties or the layer.
I think we should close the layer before we build the record id for it. Following is the code I tested against and you need to reference the corresponding data for it. private void Form1_Load(object sender, EventArgs e) { winformsMap1.MapUnit = GeographyUnit.DecimalDegree;
winformsMap1.CurrentExtent = new RectangleShape(-126.4, 48.8, -67.0, 19.0); winformsMap1.BackgroundOverlay.BackgroundBrush = new GeoSolidBrush(GeoColor.GeographicColors.ShallowOcean);