<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: editor.StartEditing(workspace) crashes ArcMap in ArcObjects SDK Questions</title>
    <link>https://community.esri.com/t5/arcobjects-sdk-questions/editor-startediting-workspace-crashes-arcmap/m-p/117726#M3073</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I tried a different user, and that didn't work though it did one time.&amp;nbsp; I stepped through debugging, and it successfully started editing.&amp;nbsp; I tried a second time and it crashed ArcMap.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 22 May 2012 14:16:58 GMT</pubDate>
    <dc:creator>ShawnHolyoak</dc:creator>
    <dc:date>2012-05-22T14:16:58Z</dc:date>
    <item>
      <title>editor.StartEditing(workspace) crashes ArcMap</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/editor-startediting-workspace-crashes-arcmap/m-p/117725#M3072</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I have a desktop addin I've built to copy features from one feature class to another.&amp;nbsp; I've built other addins before that I get my SDE workspace and start editing it.&amp;nbsp; I have no problems with those.&amp;nbsp; For whatever reason, though, this add in crashes arcmap when I call &lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;_editor.StartEditing(_workspace);&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The workspace is a valid workspace, the user has edit privileges, and like I said, I'm using the same code in other add ins and it's working.&amp;nbsp; Is there some setting somewhere that I set wrong that is causing this?&amp;nbsp; I'm about ready to start over and recreate the add in.&amp;nbsp; Any help will be appreciated.&amp;nbsp; Thanks.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 22 May 2012 13:20:50 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/editor-startediting-workspace-crashes-arcmap/m-p/117725#M3072</guid>
      <dc:creator>ShawnHolyoak</dc:creator>
      <dc:date>2012-05-22T13:20:50Z</dc:date>
    </item>
    <item>
      <title>Re: editor.StartEditing(workspace) crashes ArcMap</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/editor-startediting-workspace-crashes-arcmap/m-p/117726#M3073</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I tried a different user, and that didn't work though it did one time.&amp;nbsp; I stepped through debugging, and it successfully started editing.&amp;nbsp; I tried a second time and it crashed ArcMap.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 22 May 2012 14:16:58 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/editor-startediting-workspace-crashes-arcmap/m-p/117726#M3073</guid>
      <dc:creator>ShawnHolyoak</dc:creator>
      <dc:date>2012-05-22T14:16:58Z</dc:date>
    </item>
    <item>
      <title>Re: editor.StartEditing(workspace) crashes ArcMap</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/editor-startediting-workspace-crashes-arcmap/m-p/117727#M3074</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;If you put an exception handler do you get any kind of exception or just arcmap crashing?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 22 May 2012 18:56:44 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/editor-startediting-workspace-crashes-arcmap/m-p/117727#M3074</guid>
      <dc:creator>AlexanderGray</dc:creator>
      <dc:date>2012-05-22T18:56:44Z</dc:date>
    </item>
    <item>
      <title>Re: editor.StartEditing(workspace) crashes ArcMap</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/editor-startediting-workspace-crashes-arcmap/m-p/117728#M3075</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I thought I had error handling in place, but didn't.&amp;nbsp; When I added it, I get an insufficient permissions error, which is the problem, of course.&amp;nbsp; The new problem is, no user, other than SDE, can have edit privileges to all the feature classes in the database, based on our security model.&amp;nbsp; How do I specify that I want to edit the feature classes in one feature dataset and then start editing just that dataset?&amp;nbsp; Can that be done?&amp;nbsp; Do I have to have those feature classes in the map and get the workspace from those feature classes?&amp;nbsp; Why is this working in my other add ins?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 22 May 2012 19:06:34 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/editor-startediting-workspace-crashes-arcmap/m-p/117728#M3075</guid>
      <dc:creator>ShawnHolyoak</dc:creator>
      <dc:date>2012-05-22T19:06:34Z</dc:date>
    </item>
    <item>
      <title>Re: editor.StartEditing(workspace) crashes ArcMap</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/editor-startediting-workspace-crashes-arcmap/m-p/117729#M3076</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;You don't need permissions on all the featureclasses to start an edit session on the workspace.&amp;nbsp; You do need permissions on some of them of course.&amp;nbsp; Can you start the edit through the ArcMap interface?&amp;nbsp; Do you have versioning on the featureclasses?&amp;nbsp; Is the editor set to do edit with do/undo?&amp;nbsp; Do you have some featureclasses loaded in some layers in the map that have edit permissions?&amp;nbsp; Can you re-run the grant edit on the featureclasses you need to edit?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 22 May 2012 19:21:09 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/editor-startediting-workspace-crashes-arcmap/m-p/117729#M3076</guid>
      <dc:creator>AlexanderGray</dc:creator>
      <dc:date>2012-05-22T19:21:09Z</dc:date>
    </item>
    <item>
      <title>Re: editor.StartEditing(workspace) crashes ArcMap</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/editor-startediting-workspace-crashes-arcmap/m-p/117730#M3077</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;You don't need permissions on all the featureclasses to start an edit session on the workspace.&amp;nbsp; You do need permissions on some of them of course.&amp;nbsp; Can you start the edit through the ArcMap interface?&amp;nbsp; Do you have versioning on the featureclasses?&amp;nbsp; Is the editor set to do edit with do/undo?&amp;nbsp; Do you have some featureclasses loaded in some layers in the map that have edit permissions?&amp;nbsp; Can you re-run the grant edit on the featureclasses you need to edit?&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;That's what I thought.&amp;nbsp; I can start editing within ArcMap itself.&amp;nbsp; The feature classes are versioned.&amp;nbsp; I don't believe the editor is using do/undo, though I do use operations when I do the edits (if I could start editing that is).&amp;nbsp; I don't have any of the feature classes I will actually be editing in the map, as I don't want to depend on them being present if I don't have to (you know how users are).&amp;nbsp; I'll rerun the grant edit on the feature classes I need to edit, but the error is the same no matter the user.&amp;nbsp; I get insufficient permissions, with different feature classes throwing up the error, based on the user.&amp;nbsp; The feature classes listed in the error aren't the ones I want to edit.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I've put all my code for getting the workspace and starting editing below, in case that helps.&amp;nbsp; This identical code works in another add in.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; private void startEditing() {
&amp;nbsp;&amp;nbsp; //get the workspace necessary for editing
&amp;nbsp;&amp;nbsp; _workspace = getWorkspace();

&amp;nbsp;&amp;nbsp; //get the Editor singleton object and start editing
&amp;nbsp;&amp;nbsp; getEditor();

&amp;nbsp;&amp;nbsp; if (_editor.EditState == esriEditState.esriStateNotEditing) {
&amp;nbsp;&amp;nbsp;&amp;nbsp; try {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; _editor.StartEditing(_workspace);
&amp;nbsp;&amp;nbsp;&amp;nbsp; } catch (Exception e) {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; MessageBox.Show(e.Message);
&amp;nbsp;&amp;nbsp;&amp;nbsp; }
&amp;nbsp;&amp;nbsp; }
&amp;nbsp; }

&amp;nbsp; private void getEditor() {
&amp;nbsp;&amp;nbsp; IUID _ID = new UIDClass();

&amp;nbsp;&amp;nbsp; _ID.Value = "esriEditor.Editor";
&amp;nbsp;&amp;nbsp; _editor = ArcMap.Application.FindExtensionByName("ESRI Object Editor") as IEditor2;
&amp;nbsp; }

&amp;nbsp; public IWorkspace getWorkspace() {
&amp;nbsp;&amp;nbsp; IWorkspaceFactory2 _wsf;
&amp;nbsp;&amp;nbsp; IWorkspace _WS;
&amp;nbsp;&amp;nbsp; string _server = "";

&amp;nbsp;&amp;nbsp; try {
&amp;nbsp;&amp;nbsp;&amp;nbsp; _server = "ServerName";

&amp;nbsp;&amp;nbsp;&amp;nbsp; _wsf = new SdeWorkspaceFactoryClass();
&amp;nbsp;&amp;nbsp;&amp;nbsp; IPropertySet _ps = new PropertySetClass();
&amp;nbsp;&amp;nbsp;&amp;nbsp; _ps.SetProperty("SERVER", _server);
&amp;nbsp;&amp;nbsp;&amp;nbsp; _ps.SetProperty("INSTANCE", "5151");
&amp;nbsp;&amp;nbsp;&amp;nbsp; _ps.SetProperty("DATABASE", "");
&amp;nbsp;&amp;nbsp;&amp;nbsp; _ps.SetProperty("USER", "username");
&amp;nbsp;&amp;nbsp;&amp;nbsp; _ps.SetProperty("PASSWORD", "password");
&amp;nbsp;&amp;nbsp;&amp;nbsp; _ps.SetProperty("AUTHENTICATION_MODE", "DBMS");
&amp;nbsp;&amp;nbsp;&amp;nbsp; _ps.SetProperty("VERSION", "SDE.DEFAULT");
&amp;nbsp;&amp;nbsp;&amp;nbsp; _WS = _wsf.Open(_ps, 0);

&amp;nbsp;&amp;nbsp;&amp;nbsp; return _WS;
&amp;nbsp;&amp;nbsp; } catch (Exception) {
&amp;nbsp;&amp;nbsp;&amp;nbsp; return null;
&amp;nbsp;&amp;nbsp; }
&amp;nbsp; }

&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 06:54:38 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/editor-startediting-workspace-crashes-arcmap/m-p/117730#M3077</guid>
      <dc:creator>ShawnHolyoak</dc:creator>
      <dc:date>2021-12-11T06:54:38Z</dc:date>
    </item>
    <item>
      <title>Re: editor.StartEditing(workspace) crashes ArcMap</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/editor-startediting-workspace-crashes-arcmap/m-p/117731#M3078</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Do/undo is a property of the editor that you set in the mxd.&amp;nbsp; Basically with do/undo you must have versioning, without you can edit un-versioned data.&amp;nbsp; This could explain why it works for some add-ins and not others (the mxd being the difference.)&amp;nbsp; As a test, I wonder what would happen if you loaded an editable feature class as a layer in the map.&amp;nbsp; Another thing is you check if the editor is in the edit state before starting but there are three states, editing, not editing and editing but unfocused (active map is not the map where the edit session started.)&amp;nbsp; Your code does not account for the unfocused state, maybe something to look at.&amp;nbsp; Also it would be interesting to see if you can open a featureclass from the workspace before starting edit to see if it is working correctly.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 22 May 2012 20:06:41 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/editor-startediting-workspace-crashes-arcmap/m-p/117731#M3078</guid>
      <dc:creator>AlexanderGray</dc:creator>
      <dc:date>2012-05-22T20:06:41Z</dc:date>
    </item>
    <item>
      <title>Re: editor.StartEditing(workspace) crashes ArcMap</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/editor-startediting-workspace-crashes-arcmap/m-p/117732#M3079</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I don't work directly with SDE data all that much but if your data is versioned then shouldn't you be specifying the version you want to edit when you open the workspace?&amp;nbsp; Your code appears to be opening the default version:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;_ps.SetProperty("VERSION", "SDE.DEFAULT");&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 May 2012 12:18:28 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/editor-startediting-workspace-crashes-arcmap/m-p/117732#M3079</guid>
      <dc:creator>NeilClemmons</dc:creator>
      <dc:date>2012-05-23T12:18:28Z</dc:date>
    </item>
    <item>
      <title>Re: editor.StartEditing(workspace) crashes ArcMap</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/editor-startediting-workspace-crashes-arcmap/m-p/117733#M3080</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;There is nothing wrong with editing the default version.&amp;nbsp; It would be ill advised if you have many (&amp;gt;5) users doing it at the same time.&amp;nbsp; There are many other circumstances where that would not be good, but, in some cases, that is a perfectly legitimate thing to do.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 May 2012 12:36:41 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/editor-startediting-workspace-crashes-arcmap/m-p/117733#M3080</guid>
      <dc:creator>AlexanderGray</dc:creator>
      <dc:date>2012-05-23T12:36:41Z</dc:date>
    </item>
    <item>
      <title>Re: editor.StartEditing(workspace) crashes ArcMap</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/editor-startediting-workspace-crashes-arcmap/m-p/117734#M3081</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Without changing my code in any way, I returned to this late last week to show a colleague what was happening.&amp;nbsp; It worked fine, and still does.&amp;nbsp; I have no idea what could have been going on to prevent the code from working, but it is now working fine. Grrrr.&amp;nbsp; Thanks all, regardless.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 29 May 2012 18:39:02 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/editor-startediting-workspace-crashes-arcmap/m-p/117734#M3081</guid>
      <dc:creator>ShawnHolyoak</dc:creator>
      <dc:date>2012-05-29T18:39:02Z</dc:date>
    </item>
  </channel>
</rss>

