HowTo:  Register function tools (DLL) for both Desktop and 64-bit Background Processing

相关信息
Article ID: 40735
Software:
ArcGIS for Desktop Advanced 10.1
ArcGIS for Desktop Standard 10.1
ArcGIS for Desktop Basic 10.1
Platforms:
Windows XP, Server 2003, Server 2008, Windows 7, Windows 8

问题描述
Custom functions tools (DLLs) that are used in either Desktop or 64-bit Background Processing must be installed properly to be used in both products.

Instructions provided explain how to properly register a function tool. Without these steps, the following error may be encountered when running a function tool in the background:

"000816: The tool is invalid"
已邀请:

EsriSupport

赞同来自:

解决方案
The following steps explain how to properly register a function tool.

  1. Managed code must be compiled as ANY CPU. Set the 'Active Solution Platform' (inside Visual Studio) to Any CPU prior to compiling the dll. This is set through the configuration manager (BUILD > Configuration Manager).
  2. Open a 32-bit Command prompt from the following location: C:\Windows\SysWOW64\cmd.exe In the command window, navigate to the 32-bit ArcGIS-Bin Common Files location: C:\Program Files (x86)\Common Files\ArcGIS\bin
  3. Register the DLL using ESRIRegAsm.exe. For example: ESRIRegAsm.exe C:\tmp\GPCalculateArea.dll
  4. Choose the Desktop option from the popup window and select Register. The function tool should work properly within Desktop. Optionally, test that the tool works with Background Processing (64-bit) turned off.
    Turning off background geoprocessing enables foreground processing, which only runs in 32-bit mode.The ESRIRegAsm utility successfully set references for the tool in the 32-bit registry locations. 
  5. From the same command prompt window, generate a registry file (.reg) using the regfile switch with ESRIRegAsm.exe. For example: ESRIRegAsm.exe C:\tmp\GPCalculateArea.dll /regfile:tool.reg The .reg file is created at the same location as the DLL.
  6. Open a 64-bit Command prompt from the following location: c:\windows\system32\cmd.exe
  7. Install the .reg file into the 64-bit registry hive using the regedit command. For example: regedit c:\tmp\tool.regAccept the warning by pressing Yes to continue. A message indicating the keys and values have been successfully added to the registry should appear.
  8. If ArcMap is open, re-start the application. Enable 64-bit Background Processing from the Geoprocessing Options and execute the function tool.


其它相关参考
  1. Deploying custom .Net tools
  2. EsriRegAsm Utility


创建及修改时间
Created: 12/11/2012

Last Modified: 9/5/2013
原文链接
http://support.esri.com/en/kno ... 40735

要回复问题请先登录注册