zoukankan      html  css  js  c++  java
  • ArcEngine 9.3与64位操作系统 冲突

    ArcEngine 9.3与64位操作系统 冲突
    2011年03月30日 星期三 11:13

    错误信息:

      未处理 System.TypeInitializationException
      Message="“test.Program”的类型初始值设定项引发异常。"
      Source="test"
      TypeName="test.Program"
      StackTrace:
           在 test.Program.Main()
           在 System.AppDomain._nExecuteAssembly(Assembly assembly, String[] args)
           在 Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
           在 System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
           在 System.Threading.ThreadHelper.ThreadStart()
      InnerException: System.Runtime.InteropServices.COMException
           Message="检索 COM 类工厂中 CLSID 为 {E01BE902-CC85-4B13-A828-02E789E0DDA9} 的组件时失败,原因是出现以下错误: 80040154。"

    ------------------------------------------------------------------------------------------------------------

    一直以为是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

    Running an application from Visual Studio 2005 on 64-bit computers, displays the following error message: 

    "Error : Class not registered(Exception from HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG)"

    Cause

    When running a Visual Studio application, the default Common Language Runtime (CLR) platform in the Visual Studio is set to Any CPU. This default must be changed on 64-bit computers to compile the assemblies with the 32-bit, x86 compatible CLR.

    Workaround

    Change the default Platform Target CPU to allow applications to run on 64-bit machines:
    1. Right-click on the solution in the Visual Studio Solution Explorer and open the Properties window.
    2. Click the compile tab: Visual Basic, or the build tab: Visual C#.
    3. For Visual Basic, click the Advanced tab.
    4. Select x86 as the Target CPU (Visual Basic) or Platform Target (Visual C#).
    5. Rebuild the solution.

    Created: 5/4/2007
    Last Modified: 10/30/2009

  • 相关阅读:
    边推改革边上“保险” 央行“双降”两大亮点带来哪些变化
    今天走势将冲高回落后重新回归下跌周期
    小心!资本正在流出中国:国际收支表里被遗漏的-2547亿美元
    价格改革确立时间表和路线图 六大重点领域破题
    避免在办公室体重上升的三大良策
    别再说自己有多忙
    沪指可能展开一波3个交易日的调整
    专车新政博弈 垄断行业改革样本
    JS和CS互访【后台前台代码调用JavaScript变量以及JavaScript调用代码变量】
    net9:图片文件转换成二进制流存入SQL数据库,以及从数据库中读取二进制流输出文件
  • 原文地址:https://www.cnblogs.com/xianyin05/p/3381290.html
Copyright © 2011-2022 走看看