Select to view content in your preferred language

Core Host license with ArcGIS Server product code

2209
7
Jump to solution
01-19-2022 10:57 AM
JamieKelly1
Frequent Contributor

Hi,

I am trying to create a standalone Core Host application to update a featureclass in a scheduled task.

I am running into an issue trying to use Host.Initialize(Host.LicenseProductCode.ArcGISServer).

The license is showing that it is initializing with an Advanced License level, but later in the code I am not able to make a connection to an Enterprise Geodatabase.  I have a try catch block around it, but if there is an error, it is not getting caught.

Here is the code that crashes:

Dim gottenFeatureClass As FeatureClass = Nothing
DeedsUpdateLog.WriteToLogFile("Setting up connection properties for Deeds Feature Layer on " & instance & ".")
Dim connProps As New DatabaseConnectionProperties(EnterpriseDatabaseType.SQLServer)
connProps.AuthenticationMode = AuthenticationMode.DBMS
connProps.Instance = instance
connProps.Database = "Property"
connProps.User = usrUser
connProps.Password = usrPassword
connProps.Version = "sde.DEFAULT"

DeedsUpdateLog.WriteToLogFile("Connecting to the geodatabase.")
Dim theGeodatabase As Geodatabase = New Geodatabase(connProps)
Try
DeedsUpdateLog.WriteToLogFile("Opening the deeds featureclass.")
gottenFeatureClass = theGeodatabase.OpenDataset(Of FeatureClass)(featClassName)
DeedsUpdateLog.WriteToLogFile("Deeds featureclass opened.")
Catch ex As Exception
DeedsUpdateLog.WriteToLogFile("Error.")
gottenFeatureClass = Nothing
Throw ex
Finally
theGeodatabase.Dispose()
End Try
Return gottenFeatureClass

It crashes at line: "Dim theGeodatabase As Geodatabase = New Geodatabase(connProps)" because I am getting the log message "Connecting to the geodatabase.", but nothing else in my log after that.

It is a console application, so the console window (cmd window) opens momentarily and then dissapears, with no error messages at all.  I think it is because I am trying to use ArcGIS Server to initialize, if I use Host.Initialize(Host.LicenseProductCode.ArcGISPro) the whole process completes from start to finish.

Any ideas?

0 Kudos
1 Solution

Accepted Solutions
JamieKelly1
Frequent Contributor

Got it working.  I copied the Core and CoreHost dlls from the server framework folder to my development computer and referenced those.  I also had to set the "copy local" property of the reference to true.  When compiled, the program worked on the server against the ArcGIS Server License.  I think there was a version difference.  Details of the files show the file version of my ArcGIS Pro dlls as 12.9.0.32739 and the dlls for ArcGIS Server are 12.9.0.31642.

View solution in original post

7 Replies
by Anonymous User
Not applicable

Hi Jamie, in order to work with the ArcGISServer product code enumeration, your CoreHost application needs to be running on a machine with ArcGIS Server installed and licensed.  Also, the version of Server should be supported to be compatible with the version of Pro which you built your CoreHost app.  Some considerations are mentioned in this document

JamieKelly1
Frequent Contributor

ArcGIS Server is licensed. Could the problem be that I am developing against references in my ArcGIS Pro 10.9.1 installation, but when I move my compiled application to the server, the server has ArcGIS Server 10.9?  My compile options are set to copy the reference dlls to the compiled application's bin folder.

0 Kudos
MassimilianoGeppi
Esri Contributor

Hi Jamie & Chris

Very interested in this topic, I'm trying to build a simple "CoreHost" application that runs on a Linux ArcGIS Server.
The first question is: is it possible to do this?
The first problem encountered after successfully compiling and running a "CoreHost" application on Linux is to encounter
the message similar to this "Could not find 'ArcGIS Pro'.
I think it is necessary to fight with the "wine" emulator, but I don't know how to do it.
Is it possible to have some deep information on this? Thanks in advance.

0 Kudos
by Anonymous User
Not applicable

That could be part of the issue, depending upon your Server install.  Something else to check would be the version of Pro installed with Server.  If you continue to have issues, would recommend that you contact Esri Support and open a case on this one.

JamieKelly1
Frequent Contributor

Got it working.  I copied the Core and CoreHost dlls from the server framework folder to my development computer and referenced those.  I also had to set the "copy local" property of the reference to true.  When compiled, the program worked on the server against the ArcGIS Server License.  I think there was a version difference.  Details of the files show the file version of my ArcGIS Pro dlls as 12.9.0.32739 and the dlls for ArcGIS Server are 12.9.0.31642.

Gaurtene
Emerging Contributor

Hi JamieKeylly1!!! I am trying to create a standalone Core Host application with ArcGISServer license and my app doesn't work.

If my license is ArcGISPro the connection to the Geodatabase works, but not for ArcGISServer.

It crashes at line: "Dim theGeodatabase As Geodatabase = New Geodatabase(connProps)"

I used ArcGISServer (12.9.0.31642.) and ArcGIS PRO  libraries (12.9.0.32739) with copy local TRUE, in both cases i have the same issue.  Try with copy local FALSE, doesn't work too

Is it possible to run an app on the server with libraries and ArcGIS Server license, without installing/licensing ArcGIS Pro?

Please if you could help me, I would appreciate it

Regards

Germán.

 

0 Kudos
thejuskambi
Frequent Contributor

Do you have any update on this issue?

0 Kudos