Select to view content in your preferred language

Reading Layer results in COM Component Fail with 10.6 DLLs

281
0
07-27-2018 11:19 AM
EmanuelRamalho
New Contributor

I'm having an issue upgrading from 10.5 to 10.6 libraries. When I try to get the layer information from a layer file it aborts. All I've done was to replace 10.5 with the 10.6 DLLs and this is what I get when I try to access the Workspace:

"

Error HRESULT E_FAIL has been returned from a call to a COM component.
StackTrace: at ESRI.ArcGIS.Geodatabase.IDataset.get_Workspace()
...

"

 

I have a licensed ArcGIS Server 10.6 installed on the same box and I am initializing the license successfully in the code, however it is failing when I try to access a layer file (I've tried layers from 10.2, 10.5 and 10.6 and this was working previously). Am I missing something in the new DLLs? All I'm trying to do is:

"

var layerFile = new LayerFileClass();

layerFile.Open(m_filename);

...

var oLayer = layerFile.Layer;

...

var oDataLayer = oLayer as IDataLayer;

var oDataset = oDataLayer as IDataset;
if (oDataset == null) return;

var oWorkspace = oDataset.Workspace;

"

Thanks!

0 Kudos
0 Replies