ArcGISPortalManager can be used in a console application?

04-16-2024 04:29 AM
Occasional Contributor III

I am trying to create small application to list the portals configured in a machine/user.

I initialize the Host object:




then I try to use the singleton ArcGISPortalManager, but i keep getting a NullReferenceException

How can i use that object without having to create an Add-in?

neither here:

nor here:

are restrictions or constrains about it.

Tags (2)
0 Kudos
1 Reply
by Esri Contributor
Esri Contributor

The CoreHost has access to two namespaces, ArcGIS.CoreHost and ArcGIS.Core, to work with the geodatabase and geometry classes. Therefore, ArcGISPortalManager is unavailable for the CoreHost app.

However, you can call services from the CoreHost by registering a sign-on handler and resolving the credentials using the pattern described in ArcGIS.Core.System.Core.ArcGISSignOn with a complete authentication example illustrated in the ISignOnHandler interface. 

0 Kudos