Select to view content in your preferred language

Cannot run the ConfigWithMap sample

295
1
06-16-2022 06:03 AM
mody_buchbinder
Frequent Contributor

I am trying to run the ConfigWithMap example. I have C:\Data\Configurations\Projects with San Diago.aprx valid in it.

The error I get is "System.NotSupportedException: 'The given path's format is not supported" in external code.

I put many break point but I cannot locate the problem.

I see the first screen and then when I need to see the screen with California map I get the error.

Similar problem when I ConfigWithStartWizard.

Pro 2.9

Thanks

0 Kudos
1 Reply
GKmieliauskas
Esri Regular Contributor

Hi,

There is a problem with signing to portal. You need to move signing code from OnUpdateDatabase to OnApplicationReady. More info here:

https://community.esri.com/t5/arcgis-pro-sdk-questions/portal-login-programmatically/m-p/1000543 

 

        protected override void OnApplicationReady()
        {
            // get the login username from Portal
            var portal = ArcGISPortalManager.Current.GetActivePortal();
            if (portal != null && portal.SignIn().success)
            {
                ConfigWithMapModule.UserName = portal.GetSignOnUsername();
            }
        }
0 Kudos