Hi,
I have a plugin data source project and also its addin project. Addin project uses a reference of the plugin project. But if only addin is installed and not its plugin, Pro is crashing.
How to check if the plugin is not installed in the machine in the addin project to stop Pro to crash?
@Wolf @GKmieliauskas @UmaHarano
Solved! Go to Solution.
You can surround the creation of the PluginDatastore by try ... catch as it is implemented here:
arcgis-pro-sdk-community-samples/Plugin/SimplePointPluginTest/TestCsv2.cs at master · Esri/arcgis-pr...
In essence you need this
try
{
// you must use await in order to catch any exceptions in the new thread
await QueuedTask.Run(() =>
{
using (var pluginws = new PluginDatastore(...))
{
using (var table = pluginws.OpenTable(table_name))
{
}
}
});
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
you could also check Pro's AssemblyCache folder for the Guided folder of the Plugin, but that's a bit more involved. Either way there shouldn't be a crash.
You can surround the creation of the PluginDatastore by try ... catch as it is implemented here:
arcgis-pro-sdk-community-samples/Plugin/SimplePointPluginTest/TestCsv2.cs at master · Esri/arcgis-pr...
In essence you need this
try
{
// you must use await in order to catch any exceptions in the new thread
await QueuedTask.Run(() =>
{
using (var pluginws = new PluginDatastore(...))
{
using (var table = pluginws.OpenTable(table_name))
{
}
}
});
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
you could also check Pro's AssemblyCache folder for the Guided folder of the Plugin, but that's a bit more involved. Either way there shouldn't be a crash.