<?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: VersionManager crash when GetVersions Method is called in ArcGIS Pro SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/versionmanager-crash-when-getversions-method-is/m-p/1308982#M10040</link>
    <description>&lt;P&gt;when I delete the row that is not shown by ArcGIS Pro, then my snippets and my code work without issue. but then a nice - important too - question came to my mind, should I do that in production?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 18 Jul 2023 11:44:46 GMT</pubDate>
    <dc:creator>Cristian_Galindo</dc:creator>
    <dc:date>2023-07-18T11:44:46Z</dc:date>
    <item>
      <title>VersionManager crash when GetVersions Method is called</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/versionmanager-crash-when-getversions-method-is/m-p/1308536#M10031</link>
      <description>&lt;P&gt;There is an add-in that create a version, in the process of creating the version, it verifies the existing of the version calling the existing versions.&lt;/P&gt;&lt;P&gt;Current it is throwing at exception when connected to ONE geodatabase:&lt;/P&gt;&lt;LI-CODE lang="cpp"&gt;Unhandled exception at 0x00007FFDF2C423EB (CoreInterop.dll) in ArcGISPro_2.9.5.32739_47FF8EC5-67F0-4891-8FB6-0A95A0AC38D0_07_13_2023_15_41_05.dmp: 0xC0000005: Access violation reading location 0x0000000000000000.&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;at the beginning I though the issue was related to my code but I was able to isolate the issue, Even I create a small snippet in PowerShell that horribly crash when executed:&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;Add-Type -Path 'C:\Program Files\ArcGIS\Pro\bin\ArcGIS.CoreHost.dll'
Add-Type -Path 'C:\Program Files\ArcGIS\Pro\bin\ArcGIS.Core.dll'
[ArcGIS.Core.Hosting.Host]::Initialize()

[ArcGIS.Core.Data.DatabaseConnectionProperties]$connectionProperties = [ArcGIS.Core.Data.DatabaseConnectionProperties]::new([ArcGIS.Core.Data.EnterpriseDatabaseType]::SQLServer)

$connectionProperties.AuthenticationMode = [ArcGIS.Core.Data.AuthenticationMode]::DBMS
$connectionProperties.Instance = "YOUR_SQL_SERVER"
$connectionProperties.Database = "YOUR_DATABASE"
$connectionProperties.User = "YOUR_USER"
$connectionProperties.Password = "USER_PASSWORD"

$gdb =  [ArcGIS.Core.Data.Geodatabase]::new($connectionProperties); 

$versionManager = $gdb.GetVersionManager()
$existingVersions = $versionManager.GetVersions()

$existingVersions | %{$_.GetName()}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;the issue here is that this error only happens with one database. What should i look into the database to detect the reason of this failure, and if possible solve it.&lt;/P&gt;&lt;P&gt;One really nice thing about it is the ArcGIS Pro allows me to list and create versions using its interface.&lt;/P&gt;</description>
      <pubDate>Mon, 17 Jul 2023 08:52:23 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/versionmanager-crash-when-getversions-method-is/m-p/1308536#M10031</guid>
      <dc:creator>Cristian_Galindo</dc:creator>
      <dc:date>2023-07-17T08:52:23Z</dc:date>
    </item>
    <item>
      <title>Re: VersionManager crash when GetVersions Method is called</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/versionmanager-crash-when-getversions-method-is/m-p/1308627#M10032</link>
      <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/104075"&gt;@Cristian_Galindo&lt;/a&gt;&amp;nbsp;Can you connect the database through the Pro UI and create versions manually in the Pro?&lt;/P&gt;&lt;P&gt;You could list version names using VersionManager.GetVersionNames() method, rather&amp;nbsp;VersionManager.GetVersions(), which will attempt to connect to every version in the system.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 17 Jul 2023 15:25:50 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/versionmanager-crash-when-getversions-method-is/m-p/1308627#M10032</guid>
      <dc:creator>Aashis</dc:creator>
      <dc:date>2023-07-17T15:25:50Z</dc:date>
    </item>
    <item>
      <title>Re: VersionManager crash when GetVersions Method is called</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/versionmanager-crash-when-getversions-method-is/m-p/1308657#M10033</link>
      <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/221628"&gt;@Aashis&lt;/a&gt;&amp;nbsp;as I already mentioned&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;P&gt;&lt;SPAN&gt;One really nice thing about it is the ArcGIS Pro allows me to list and create versions using its interface.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;SPAN&gt;I confirm: I can connect to the database and create versions manually.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 17 Jul 2023 15:53:33 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/versionmanager-crash-when-getversions-method-is/m-p/1308657#M10033</guid>
      <dc:creator>Cristian_Galindo</dc:creator>
      <dc:date>2023-07-17T15:53:33Z</dc:date>
    </item>
    <item>
      <title>Re: VersionManager crash when GetVersions Method is called</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/versionmanager-crash-when-getversions-method-is/m-p/1308869#M10034</link>
      <description>&lt;P&gt;Although the Pro SDK doesn't provide support for Powershell, it happens to work for you. Can you convert the script into a C# based Corehost application and see if you can get additional debug information related to the geodatabase?&lt;/P&gt;&lt;P&gt;If not, can we get a sample dataset to reproduce the issue in our machine?&lt;/P&gt;</description>
      <pubDate>Mon, 17 Jul 2023 23:56:57 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/versionmanager-crash-when-getversions-method-is/m-p/1308869#M10034</guid>
      <dc:creator>Aashis</dc:creator>
      <dc:date>2023-07-17T23:56:57Z</dc:date>
    </item>
    <item>
      <title>Re: VersionManager crash when GetVersions Method is called</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/versionmanager-crash-when-getversions-method-is/m-p/1308922#M10035</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/221628"&gt;@Aashis&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;here you have the same snippet but in C#:&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;void Main()
{
	ArcGIS.Core.Hosting.Host.Initialize();
	ArcGIS.Core.Data.DatabaseConnectionProperties connectionProperties = new(ArcGIS.Core.Data.EnterpriseDatabaseType.SQLServer);
	connectionProperties.Instance = "YOUR_SQL_SERVER";
	connectionProperties.Database = "YOUR_DATABASE";
	connectionProperties.User = "YOUR_USER";
	connectionProperties.Password = "USER_PASSWORD";

	var gdb = new ArcGIS.Core.Data.Geodatabase(connectionProperties);
	
	var versionManager = gdb.GetVersionManager();
	var existingVersions = versionManager.GetVersions();
	foreach (var version in existingVersions)
	{
		Console.WriteLine(version.GetName());
	}
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;As I already mention this happens just in one database, I have tried to spot the difference between a functional one an the faulty one, but I can not narrow the difference.&lt;/P&gt;</description>
      <pubDate>Tue, 18 Jul 2023 07:54:09 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/versionmanager-crash-when-getversions-method-is/m-p/1308922#M10035</guid>
      <dc:creator>Cristian_Galindo</dc:creator>
      <dc:date>2023-07-18T07:54:09Z</dc:date>
    </item>
    <item>
      <title>Re: VersionManager crash when GetVersions Method is called</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/versionmanager-crash-when-getversions-method-is/m-p/1308970#M10037</link>
      <description>&lt;P&gt;following the recommendation of&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/221628"&gt;@Aashis&lt;/a&gt;&amp;nbsp;I changed my code to use&amp;nbsp;&lt;SPAN&gt;VersionManager.GetVersionNames() method: the result is the same I am still getting an exception:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;"Attempted to read or write protected memory. This is often an indication that other memory is corrupt."&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 18 Jul 2023 11:15:58 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/versionmanager-crash-when-getversions-method-is/m-p/1308970#M10037</guid>
      <dc:creator>Cristian_Galindo</dc:creator>
      <dc:date>2023-07-18T11:15:58Z</dc:date>
    </item>
    <item>
      <title>Re: VersionManager crash when GetVersions Method is called</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/versionmanager-crash-when-getversions-method-is/m-p/1308978#M10038</link>
      <description>&lt;P&gt;checking the versions on the geodatabase I found: the records in the database are not the same that ArcGIS Pro 2.9 shows:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Cristian_Galindo_0-1689679855918.png" style="width: 999px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/75608i23AC053FC7AFCC7A/image-size/large?v=v2&amp;amp;px=999" role="button" title="Cristian_Galindo_0-1689679855918.png" alt="Cristian_Galindo_0-1689679855918.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Cristian_Galindo_1-1689679887732.png" style="width: 999px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/75609i2284D8308F486257/image-size/large?v=v2&amp;amp;px=999" role="button" title="Cristian_Galindo_1-1689679887732.png" alt="Cristian_Galindo_1-1689679887732.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 18 Jul 2023 11:31:49 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/versionmanager-crash-when-getversions-method-is/m-p/1308978#M10038</guid>
      <dc:creator>Cristian_Galindo</dc:creator>
      <dc:date>2023-07-18T11:31:49Z</dc:date>
    </item>
    <item>
      <title>Re: VersionManager crash when GetVersions Method is called</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/versionmanager-crash-when-getversions-method-is/m-p/1308982#M10040</link>
      <description>&lt;P&gt;when I delete the row that is not shown by ArcGIS Pro, then my snippets and my code work without issue. but then a nice - important too - question came to my mind, should I do that in production?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 18 Jul 2023 11:44:46 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/versionmanager-crash-when-getversions-method-is/m-p/1308982#M10040</guid>
      <dc:creator>Cristian_Galindo</dc:creator>
      <dc:date>2023-07-18T11:44:46Z</dc:date>
    </item>
    <item>
      <title>Re: VersionManager crash when GetVersions Method is called</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/versionmanager-crash-when-getversions-method-is/m-p/1308997#M10041</link>
      <description>&lt;P&gt;After reading a little bit I found the invisible version belongs to a replica of the geodatabase:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Cristian_Galindo_2-1689682889889.png" style="width: 999px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/75612i72302EA4EFFAF9DB/image-size/large?v=v2&amp;amp;px=999" role="button" title="Cristian_Galindo_2-1689682889889.png" alt="Cristian_Galindo_2-1689682889889.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://support.esri.com/en-us/knowledge-base/faq-what-are-the-syncsend-and-syncreceive-versions-in-t-000009436" target="_blank"&gt;https://support.esri.com/en-us/knowledge-base/faq-what-are-the-syncsend-and-syncreceive-versions-in-t-000009436&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://pro.arcgis.com/en/pro-app/latest/help/data/geodatabases/overview/synchronization-and-versioning.htm" target="_blank"&gt;https://pro.arcgis.com/en/pro-app/latest/help/data/geodatabases/overview/synchronization-and-versioning.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;I confirm that in the dialog Manage replicas:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Cristian_Galindo_3-1689683120199.png" style="width: 999px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/75614i631470429DBE4739/image-size/large?v=v2&amp;amp;px=999" role="button" title="Cristian_Galindo_3-1689683120199.png" alt="Cristian_Galindo_3-1689683120199.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I unregister the the replica, and the row was deleted:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Cristian_Galindo_4-1689683204455.png" style="width: 999px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/75615i868CDAE855055A47/image-size/large?v=v2&amp;amp;px=999" role="button" title="Cristian_Galindo_4-1689683204455.png" alt="Cristian_Galindo_4-1689683204455.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Now the script and the add-in are working&lt;/P&gt;&lt;P&gt;I will proceed to test this in ArcGIS Pro 3.*, and possible to create bug, because the SDK functionality in the VersionManager is not compatible with the replica functionality.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-unicode-emoji" title=":confounded_face:"&gt;😖&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 18 Jul 2023 12:28:56 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/versionmanager-crash-when-getversions-method-is/m-p/1308997#M10041</guid>
      <dc:creator>Cristian_Galindo</dc:creator>
      <dc:date>2023-07-18T12:28:56Z</dc:date>
    </item>
  </channel>
</rss>

