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"%>
  • 相关阅读:
    我爱java系列之---【微服务间的认证—Feign拦截器】
    我爱java系列之---【设置权限的三种解决方案】
    581. Shortest Unsorted Continuous Subarray
    129. Sum Root to Leaf Numbers
    513. Find Bottom Left Tree Value
    515. Find Largest Value in Each Tree Row
    155. Min Stack max stack Maxpop O(1) 操作
    painting house
    Minimum Adjustment Cost
    k Sum
  • 原文地址:https://www.cnblogs.com/Leechg/p/6501166.html
Copyright © 2011-2022 走看看