AuthorizeASRFromFile() fails with ErrorCode -2147467259

4095
6
02-14-2013 02:35 PM
GaryMontgomery
New Contributor
Background:
I am trying to authorize using an ESLF file from ESRI in code. The method calls are the same as used in 10.0 to authorize against an ASR file.

When I call:
pAuth.AuthorizeASRFromFile(asrLocation, password)


I get "Error HRESULT E_FAIL has been returned from a call to a COM component."
The error code is  -2147467259

I have searched ESRI and Google but have not been able to find this error code.

The ESLF file is in the app folder next to the former 10.0 ASR file. The password is the same as the old ASR file according to ESRI.

I used Process Monitor to check if there was a security issue with the service accessing the file. The file never pops up in PM. And just to check that there was not an issue with my PM filter I clicked on the file in explorer and PM immediately registers the file access.

Any ideas? This should not be that difficult.

-Gary
Tags (2)
0 Kudos
6 Replies
RichardWatson
Frequent Contributor
The underlying ESRI ArcObjects are written in C++ and some of them provide extended error information.

One thing that you could try to to write the function in C++ and see if there is additional error information.

http://resources.arcgis.com/en/help/arcobjects-cpp/componenthelp/index.html#//001n000001rw000000
0 Kudos
GaryMontgomery
New Contributor
Thank you, Richard. I will give that a try and hopefully see something useful.
0 Kudos
GaryMontgomery
New Contributor
Before I got around to writing a little C++ app I found that double clicking the ESLF opens a wizard to add your licenses to the License manager. After doing so you don't need to call pAuth.AuthorizeASRFromFile(asrLocation, password)

ESRI.ArcGIS.RuntimeManager.Bind(ESRI.ArcGIS.ProductCode.EngineOrDesktop)
Dim aoInit As IAoInitialize = New AoInitializeClass
aoInit.Initialize(esriLicenseProductCode.esriLicenseProductCodeEngineGeoDB)
aoInit.Initialize(esriLicenseProductCode.esriLicenseProductCodeEngine)


Does the trick and I don't need to find out what the heck is wrong with esri's SDK code.
0 Kudos
nagavijayasankaran
New Contributor
Hi,

I am running into the same issue with version 10.2.2. We will need the ability to authorize and deauthorize programatically. I am getting error "-98  Could not load AfCore.dll"

Thanks,
Naga
0 Kudos
MichaelThompson
New Contributor III

naga vijayasankaran​,

Did you ever get an answer for this? We are experiencing the same error.

Thanks!

Michael

0 Kudos
nagavijayasankaran
New Contributor

Hello Michael,

I did not bring this up with ESRI Support. Just double clicking the eslf file will launch the license manager and we went with this workaround for now.

Thanks,

naga

0 Kudos