Getting Started Help

817
2
09-21-2012 04:46 AM
JustinHunter
New Contributor III
Hey all,

I'm having some issues getting started with this. My goal is to make a WCF service that uses ArcObjects that our already existing CMS system will plug into to do queries and whatnot. There is no map whatsoever (other than exporting one based on parameters given and making it a image file, and displaying that) but I can't figure out where to even get started.

I'm doing a very simple: try to connect to my workspace and do a spatial query on one of my feature classes. Works great in a console application, because I have this LicenseInitializer.cs file pre-made for me, but this is going to be a class library. This file does not get create for me and it will not compile if I copy the class over.

The errors that I receive are:
Error 1 The type 'ESRI.ArcGIS.esriSystem.AoInitializeClass' has no constructors defined
Error 2 Interop type 'ESRI.ArcGIS.esriSystem.AoInitializeClass' cannot be embedded. Use the applicable interface instead.

I'm wondering if anyone knows which direction to go with this? So far I've been able to use my REST services to do everything I need, but now I need to be able to export a cached map into an image, but have the ability to put points of interest (based on parameters passed in) dynamically before exporting it to an image file.

Thanks
0 Kudos
2 Replies
RiverTaig1
Occasional Contributor
I'm having the exact same issue. "Interop type 'ESRI.ArcGIS.esrySystem.AoInitializeClass' Cannot be embedded. Use the applicable interface instead".  In my case, this is a WPF windows application which needs to connect to a geodatabase and do some ArcObjects processing of data, and as such I need to acquire a license (since it won't be running in ArcMap's memory space).  I also have a Console application that acquires a license just fine (using the provided ESRI templates).  I checked both projects to make sure that they are using the same flavor of that .NET runtime (they are). I'm at wit's end here. I have another error (probably related to the first) that says, "The type 'ESRI.ArcGIS.esriSystem.AoInitialize' has no constructors defined'".  In the WPF project, I can view AoInitializeClass in the Object Browser and see that it does have such a constructor defined.
How do you acquire a license in a WPF windows application?
0 Kudos
RiverTaig1
Occasional Contributor
Well that was easy!!  A little more Googling, and the answer is here: http://gis.stackexchange.com/questions/5782/no-constructor-defined

In a nutshell, find ESRI.ArcGIS.System in the references list, and change "Embded Interop Types" to False.
0 Kudos