zoukankan      html  css  js  c++  java
  • 当前线程不在单线程单元中,因此无法实例化 ActiveX 控件

    “/”应用程序中的服务器错误。
    
    当前线程不在单线程单元中,因此无法实例化 ActiveX 控件“c552ea94-6fbb-11d5-a9c1-00104bb6fc1c”。
    
    说明: 执行当前 Web 请求期间,出现未经处理的异常。请检查堆栈跟踪信息,以了解有关该错误以及代码中导致错误的出处的详细信息。 
    
    异常详细信息: System.Threading.ThreadStateException: 当前线程不在单线程单元中,因此无法实例化 ActiveX 控件“c552ea94-6fbb-11d5-a9c1-00104bb6fc1c”。
    
    源错误: 
    
    
    行 17: {
    行 18:     MapManager m_pMapManager;
    行 19:     ESRI.ArcGIS.Controls.AxMapControl MapCtrl = new AxMapControl();
    行 20: 
    行 21:     List<IPoint> m_ArrCutLinePoints = new List<IPoint>();  
    源文件:      行: 19 
    
    堆栈跟踪: 
    
    
    [ThreadStateException: 当前线程不在单线程单元中,因此无法实例化 ActiveX 控件“c552ea94-6fbb-11d5-a9c1-00104bb6fc1c”。]
       System.Windows.Forms.AxHost..ctor(String clsid, Int32 flags) +3705969
       System.Windows.Forms.AxHost..ctor(String clsid) +11
       ESRI.ArcGIS.Controls.AxMapControl..ctor() +57
       
       System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +51
       System.Web.UI.Control.OnLoad(EventArgs e) +95
       System.Web.UI.Control.LoadRecursive() +59
       System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +678

    在aspx  page标签中添加 

    AspCompat="true"
    <%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default"  AspCompat="true"%>
  • 相关阅读:
    py2exe
    Python库
    Python正则表达式指南
    [Python]日志模块logging的应用
    [Python]python __init__.py
    如何安装配置ulipad
    [Python]如何快速知道要使用哪些python模块和有哪些功能
    CodeIgniter
    Python 绝对简明手册
    理解Python命名机制
  • 原文地址:https://www.cnblogs.com/Leechg/p/6501166.html
Copyright © 2011-2022 走看看