I am working on my first CoreHost application and am running into issues deploying it. The CoreHost application is a console application that I can debug and run successfully in Visual Studio 2022, and I can run it by hand outside of Visual Studio. The issue is that this application will be run at night with other batch jobs, and when I attempt to have the scheduling software execute it, it fails- but it fails at an unexpected location. The code begins to execute and even opens a couple of feature classes, but when I try to do anything with spatial references, that is when it fails. Both bits of code below fail. If I were initializing incorrectly or didn't have the licensing configured properly, I would expect not to be able to open feature classes, but that part is successful. I am running Pro 3.3.4.
SpatialReference pSRWebMerc_3857 = SpatialReferences.WebMercator;
or
SpatialReference pSRWebMercAuxSph84_3857 = null;
SpatialReferenceBuilder spatialReferenceBuilder = new SpatialReferenceBuilder(3857);
pSRWebMercAuxSph84_3857 = spatialReferenceBuilder.ToSpatialReference();
This is the error:
CoreInterop
at CGeometryInterop.CreateSpatialReferenceFromID_(CGeometryInterop*, Int32 wkid, Int32 vWkid, ISpatialReference** ppSR)
at CGeometryInterop.CreateSpatialReferenceFromID(CGeometryInterop*, Int32 wkID, Int32 wkvID, Void** outHandle)
at ArcGIS.Core.Internal.ISpatialReferenceIOP.CreateSpatialReferenceFromID(Int32 wkID, Int32 wkvID)
at ArcGIS.Core.Geometry.SpatialReferenceBuilder..ctor(Int32 wkid, Int32 verticalWkid, Boolean validateThread)
at ArcGIS.Core.Geometry.SpatialReferenceBuilder..ctor(Int32 wkid)
at UpdateFeatureClass.PerformCoreHostTask(String[] args) in \Dev\Repos\UpdateFeatureClass\clsUpdate.cs
Thoughts anyone??
Thank you!!!
Yeah, the SYSTEM account does have access.
Thank you.