Select to view content in your preferred language

Project Open failed in ArcGIS Pro 3.7

91
0
yesterday
RadekMandovec
Regular Contributor

Hi,

in our Add-In we open a template APRX, which is basically empty project. We do this when Pro is starting in an event OnAppStartupReady and we used the code below. Everything worked fine until we upgraded to ArcGIS Pro 3.7. Now we receive an error message (but not always, sometimes it runs without error): "Project Open Failed: the project portal is not the active portal!"

If I put a breakpoint on a row with:

await Project.OpenAsync(pathToTemplate);

and wait couple of seconds, it opens Template.aprx without any error, but when I try the same with using 10 seconds delay:

Thread.Sleep(10000);

 it sometimes opens with the error and sometimes without it.

We use the same code since ArcGIS Pro 3.4 and never have any problem with it.

public static async Task<bool> OpenEmptyAprx(pathToTemplate)
{
    try
    {
        await Project.OpenAsync(pathToTemplate);
    }
    catch (Exception e)
    {
                return false;
    }
    return true;
}

 

0 Kudos
0 Replies