ArcEngine9.3与64位操作系统冲突问题的解决办法
错误信息: 未处理 System.TypeInitializationException ------------------------------------------------------------------------------------------------------------ 一直以为是Engine的安装版本与机器上的其他ArcGIS产品的版本不符,可是最后折腾到了一台没有装ArcGIS产品的服务器上,问题依旧。VS调试发现,从程序的入口检查License文件开始便报如上错误。在确认ArcEngine的运行许可可用的前提下,究竟是什么问题导致的这种情况。 原因是:X64位的系统不支持, 解决办法如下: 所有引用ArcEngine9.3的DLL的工程中编译代码的时候把目标平台anyCPU改为X86。重新编译就可以了。 |
其他人员的相关阅读资料:
VS2010在WIN7 X64上编译以前在x84 XP上的Skyline程序遇到同样问题,参照如下此贴解决。
---------------------
VS2008 在64位的系统(XP/Vista/Win7均是)中编译ArcEngine(9.3SP1)并运行时提示:
没有注册类 (异常来自 HRESULT:0x80040154 (REGDB_E_CLASSNOTREG))
原因:ArcEngine9.3没有原生支持64位,而是以32位兼容方式运行
解决办法:在项目属性里设置“生成”=>“目标平台”为x86而不是默认的ANY CPU.
ESRI官方也是这么解决的:
http://support.esri.com/index.cfm?fa=knowledgebase.techarticles.articleShow&d=33000
Bug: Error: Class not registered(Exception from HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG)
Article ID: | 33000 |
---|---|
Bug Id: | NIM007516 |
Software: | ArcGIS Engine Runtime 9.2, 9.3 |
Platforms: | Windows 2000, XP |
Description
"Error : Class not registered(Exception from HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG)"
Cause
Workaround
- Right-click on the solution in the Visual Studio Solution Explorer and open the Properties window.
- Click the compile tab: Visual Basic, or the build tab: Visual C#.
- For Visual Basic, click the Advanced tab.
- Select x86 as the Target CPU (Visual Basic) or Platform Target (Visual C#).
- Rebuild the solution.
Created: 5/4/2007
Last Modified: 10/30/2009