register custom class extensions on arcgis server

5336
9
Jump to solution
01-21-2013 08:41 AM
RobertZargarian
New Contributor III
Hi
I am using ArcGIS for Server 10.1 and 9.3.1 SDE geodatabase. I have couple of custom
class extensions registered in geodatabase. These extensions are also deployed on server machine.
MXD for ArcMap with these feature classes works fine on server machine.
When I publish a service from my MXD then I get warning
???Layer is being published with custom class extension??? then I get error starting service and at last features with
class extension are not present in my service.
My question is. Do I have to do something else to register class extensions (.dll-s) on ArcGIS Server?

Regards
Robert
Tags (2)
1 Solution

Accepted Solutions
RobertZargarian
New Contributor III
Thank you very much!

I was trying to register with ESRIRegasm from Progran(x86) because I have arcgis desktop on the same machine.
I tried with ESRIRegasm in Program Files and it works fine.
This is my .bat file.

cd "C:\Program Files\Common Files\ArcGIS\bin"
ESRIRegasm.exe "path\filename.dll" /e /p:server /v:10.1 /w: "path"

I renamed resulting xml-file to config.xml and created zip archive with .ecfg extension and copied it to
C:\Program Files\ArcGIS\Server\bin\Configuration\CATID

And success!

Regards
Robert

View solution in original post

9 Replies
RichardWatson
Frequent Contributor
You have to register the class extensions with ArcGIS Server which also means that they have to be x64.

ESRIRegAsm produces ecfg files which should be here:

C:\Program Files\Common Files\ArcGIS\Server10.1\Configuration\CATID
0 Kudos
RobertZargarian
New Contributor III
Thank you for replying.

I registered my class extension .dll.s with ESRIRegasm and got an .xml-file with categories and clsid-s in it. This file had extension .ecfg. I renamed it to .xml and packed it with zip. Then I renamed this file to .ecfg. If I look inside the zip arcive the filename extension is .xml. Then I placed it in
C:\Program Files\Common Files\ArcGIS\Server10.1\Configuration\CATID

I can open and look at properties for featureclasses with classextensions In Arccatalog. But when I publish the service with a those featureclass then I get warning
�??Layer is being published with custom class extension�?� and when I publish get other message.
�??Service started with errors�?�, �??The base table definition string [table name] is invalid�?�

I can�??t build project with �??Platform target�?� x64 when there are references in class extensions to 32-bit dll-s such as
Interfaces that class extensions have to implement (IClassExtension).

Regards
Robert
0 Kudos
RichardWatson
Frequent Contributor
"Layer is being published with custom class extension" is a message that you just have to ignore.

"The base table definition string ..." is a message that has to be addressed.  Others have this same issue so I suggest to the search the forum for those posts.

IClassExtension is in Geodatabase and that is in GAC_MSIL.  Why do you say that this is a 32 bit DLL?

You absolutely have to build you class extensions such that they can run in the context of a 64 bit process.  That can be x64 or GAC_MSIL.  That cannot be x86.  You cannot reference any 32 bit only assemblies or code.
0 Kudos
RobertZargarian
New Contributor III
Thank you for replying.

I have not been able to create and register custom clas extensions for x64.
In Visual Studio 2010 I put in the "platform target" x64 and "Register for COM interop" is not checked so I can compile
but it will not register with ESRIRegasm program. I get the following error "LoadLibrary failed with Unspecified path".

However, if I compile with "ANY CPU" then I can register with ESRIRegasm. But I get the error when starting the service.
Am I doing something wrong?

Regards
Robert
0 Kudos
RichardWatson
Frequent Contributor
If it won't build when you check Register for COM Interop then that is a sign that something is wrong.  You need to fix this first.
0 Kudos
RobertZargarian
New Contributor III
I am getting "File <path to assembly> is not a valid assembly" error when
I try to compile with "Register for COM interop" option 64-bit assembly.
Then I followed link here.

http://social.msdn.microsoft.com/Forums/en-US/vsdebug/thread/9d9563f1-a1e0-4aed-850e-f33e2f2eff1c

I could compile with setting 64-bit regasm as post event. But this does not help. I steel cannot run ESRIRegasm
on this .dll.
Any other ideas?

Regards
Robert
0 Kudos
RichardWatson
Frequent Contributor
Make sure that you run the 64 bit version of ESRIRegAsm.  Search your drive for it.  It should be under C:\Program Files and not C:\Program Files (x86).

Make sure that you tell ESRIRegAsm that you are registering for the Server product.  This is a command line switch.

ESRIRegAsm will create ecfg file(s) for you and will place them in the correct directory.  You can unzip these to look at the contents but ArcGIS Server needs ecfg file(s).  Make sure that the files were created but do not modify them.

If this does not work then post the >exact< command line that you are using to run ESRIRegAsm.
0 Kudos
RobertZargarian
New Contributor III
Thank you very much!

I was trying to register with ESRIRegasm from Progran(x86) because I have arcgis desktop on the same machine.
I tried with ESRIRegasm in Program Files and it works fine.
This is my .bat file.

cd "C:\Program Files\Common Files\ArcGIS\bin"
ESRIRegasm.exe "path\filename.dll" /e /p:server /v:10.1 /w: "path"

I renamed resulting xml-file to config.xml and created zip archive with .ecfg extension and copied it to
C:\Program Files\ArcGIS\Server\bin\Configuration\CATID

And success!

Regards
Robert
RichardWatson
Frequent Contributor
I have an x64 C++ project which has the following post build event:

    <PostBuildEvent>
      <Command>"$(CommonProgramW6432)\ArcGIS\bin\esriregasm.exe" "$(TargetPath)" /p:Server /s</Command>
    </PostBuildEvent>

If you do the above then you don't have to anything with XML.  This produces the ecfg file you need in the directory that you need it.

If this solved your problem can you mark my response as an answer?
0 Kudos