Arcgis Engine 10.1 Attempted to read or write protected memory error.

3917
2
01-15-2013 10:51 AM
KrishnaSista
New Contributor
We are in process of upgrading our sde to 10.1 from 9.3.1. I have a Arcgis engine console application coverted to Arcgis 10.1. The exe runs itself runs fine when i run manually, but when i run as sql job it giving me following error.

"Unhandled Exception:System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt. at ESRI.ArcGIS.esriSystem.AoInitializeClass.IsProductCodeAvailable(esriLicenseProductCode ProductCode) at LicenseInitializer.Initialize() "

According to my understanding we donot have to install arcgis engine developer kit on server. Arcgis engine application should be able to run using desktop license.

Server - Windows server 2008, Enterprise
ArcSDE - 64bit - SP1
Arcgis dekstop - sp1
SQL server 2008 R2

I Set the project to run under - x86 platform
Embed Interop Types - False.

Does anybody have a clue?

Thanks
0 Kudos
2 Replies
NeilDuxbury
New Contributor II

We encountered a similar error with a command line application running from Windows Task Scheduler. We had to check the 'Run with highest privileges' option on the General tab of Task properties.

0 Kudos
GwenRoyakkers
New Contributor III

This exception is thrown usually when you use a variable (or pass it to a function) with a member pointing to another read-only or non-existing (non-initialized) object.

It depends on your code but usually I solve this with the IClone interface.

In a debugger you can usually spot which variable is the culprit.

(in your case it might be needed to put a debug build on the server, and start a remote debugging session to see where it goes wrong)

0 Kudos