【问题标题】:AutoCAD 2014: System.Runtime.InteropServices.COMException (0x80029C4A) (TYPE_E_CANTLOADLIBRARY))AutoCAD 2014:System.Runtime.InteropServices.COMException (0x80029C4A) (TYPE_E_CANTLOADLIBRARY))
【发布时间】:2017-02-07 23:44:41
【问题描述】:

我使用 ObjectARX 2013 在 vb.net 2013 中为 AutoCAD 2013 创建了 classLibrary dll。它在 AutoCAD 2013 32 位和 64 位(winxp、win7、win8)中运行良好。我为 AutoCAD 2014 和库复制的同一程序使用了 ObjectARX 2014。但是当我在 AutoCAD 2014 中运行时出现此错误。

请帮助我。我该怎么办?

Application does not support just-in-time (JIT)
debugging. See the end of this message for details.

************** Exception Text **************
System.Runtime.InteropServices.COMException (0x80029C4A): Error loading type library/DLL. (Exception from HRESULT: 0x80029C4A (TYPE_E_CANTLOADLIBRARY))
   at System.RuntimeType.InvokeDispMethod(String name, BindingFlags invokeAttr, Object target, Object[] args, Boolean[] byrefModifiers, Int32 culture, String[] namedParameters)
   at System.RuntimeType.InvokeMember(String name, BindingFlags bindingFlags, Binder binder, Object target, Object[] providedArgs, ParameterModifier[] modifiers, CultureInfo culture, String[] namedParams)
   at Microsoft.VisualBasic.CompilerServices.VBBinder.InvokeMember(String name, BindingFlags invokeAttr, Type objType, IReflect objIReflect, Object target, Object[] args, String[] namedParameters)
   at Microsoft.VisualBasic.CompilerServices.LateBinding.InternalLateCall(Object o, Type objType, String name, Object[] args, String[] paramnames, Boolean[] CopyBack, Boolean IgnoreReturn)
   at PV3D.Module1.Head(Double ID, Double thk)
   at PV3D.Form1.Button1_Click_1(Object sender, EventArgs e)
   at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
   at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
   at System.Windows.Forms.Control.WndProc(Message& m)
   at System.Windows.Forms.ButtonBase.WndProc(Message& m)
   at System.Windows.Forms.Button.WndProc(Message& m)
   at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)


************** Loaded Assemblies **************
mscorlib
    Assembly Version: 4.0.0.0
    Win32 Version: 4.0.30319.18408 built by: FX451RTMGREL
    CodeBase: file:///C:/Windows/Microsoft.NET/Framework64/v4.0.30319/mscorlib.dll
----------------------------------------
Acdbmgd
    Assembly Version: 19.1.0.0
    Win32 Version: 19.1.18.0.0
    CodeBase: file:///C:/Program%20Files/Autodesk/AutoCAD%202014/AcdbMgd.DLL
----------------------------------------
System
    Assembly Version: 4.0.0.0
    Win32 Version: 4.0.30319.18408 built by: FX451RTMGREL
    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System/v4.0_4.0.0.0__b77a5c561934e089/System.dll
----------------------------------------
System.Core
    Assembly Version: 4.0.0.0
    Win32 Version: 4.0.30319.18408 built by: FX451RTMGREL
    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Core/v4.0_4.0.0.0__b77a5c561934e089/System.Core.dll
----------------------------------------
AdApplicationFrame
    Assembly Version: 0.0.0.0
    Win32 Version: 4.0.19.0
    CodeBase: file:///C:/Program%20Files/Autodesk/AutoCAD%202014/AdApplicationFrame.DLL
----------------------------------------
AdWindows
    Assembly Version: 4.0.24.0
    Win32 Version: 4.0.24.0
    CodeBase: file:///C:/Program%20Files/Autodesk/AutoCAD%202014/AdWindows.DLL
----------------------------------------
PresentationFramework
    Assembly Version: 4.0.0.0
    Win32 Version: 4.0.30319.18408
    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/PresentationFramework/v4.0_4.0.0.0__31bf3856ad364e35/PresentationFramework.dll
----------------------------------------
WindowsBase
    Assembly Version: 4.0.0.0
    Win32 Version: 4.0.30319.18408 built by: FX451RTMGREL
    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/WindowsBase/v4.0_4.0.0.0__31bf3856ad364e35/WindowsBase.dll
----------------------------------------
PresentationCore
    Assembly Version: 4.0.0.0
    Win32 Version: 4.0.30319.18408 built by: FX451RTMGREL
    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_64/PresentationCore/v4.0_4.0.0.0__31bf3856ad364e35/PresentationCore.dll
----------------------------------------
System.Xaml
    Assembly Version: 4.0.0.0
    Win32 Version: 4.0.30319.18408 built by: FX451RTMGREL
    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Xaml/v4.0_4.0.0.0__b77a5c561934e089/System.Xaml.dll
----------------------------------------
System.Xml
    Assembly Version: 4.0.0.0
    Win32 Version: 4.0.30319.18408 built by: FX451RTMGREL
    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Xml/v4.0_4.0.0.0__b77a5c561934e089/System.Xml.dll
----------------------------------------
PresentationFramework.Aero2
    Assembly Version: 4.0.0.0
    Win32 Version: 4.0.30319.18408 built by: FX451RTMGREL
    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/PresentationFramework.Aero2/v4.0_4.0.0.0__31bf3856ad364e35/PresentationFramework.Aero2.dll
----------------------------------------
System.Drawing
    Assembly Version: 4.0.0.0
    Win32 Version: 4.0.30319.18408 built by: FX451RTMGREL
    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Drawing/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll
----------------------------------------
accoremgd
    Assembly Version: 19.1.0.0
    Win32 Version: 19.1.18.0.0
    CodeBase: file:///C:/Program%20Files/Autodesk/AutoCAD%202014/accoremgd.DLL
----------------------------------------
Acmgd
    Assembly Version: 19.1.0.0
    Win32 Version: 19.1.18.0.0
    CodeBase: file:///C:/Program%20Files/Autodesk/AutoCAD%202014/Acmgd.DLL
----------------------------------------
System.Configuration
    Assembly Version: 4.0.0.0
    Win32 Version: 4.0.30319.18408 built by: FX451RTMGREL
    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Configuration/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll
----------------------------------------
AcWindows
    Assembly Version: 19.1.0.0
    Win32 Version: 19.1.18.0.0
    CodeBase: file:///C:/Program%20Files/Autodesk/AutoCAD%202014/AcWindows.DLL
----------------------------------------
AcCui
    Assembly Version: 19.1.0.0
    Win32 Version: 19.1.18.0.0
    CodeBase: file:///C:/Program%20Files/Autodesk/AutoCAD%202014/AcCui.DLL
----------------------------------------
PresentationFramework-SystemXml
    Assembly Version: 4.0.0.0
    Win32 Version: 4.0.30319.17929
    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/PresentationFramework-SystemXml/v4.0_4.0.0.0__b77a5c561934e089/PresentationFramework-SystemXml.dll
----------------------------------------
PresentationFramework.Aero
    Assembly Version: 4.0.0.0
    Win32 Version: 4.0.30319.17929 built by: FX45RTMREL
    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/PresentationFramework.Aero/v4.0_4.0.0.0__31bf3856ad364e35/PresentationFramework.Aero.dll
----------------------------------------
WindowsFormsIntegration
    Assembly Version: 4.0.0.0
    Win32 Version: 4.0.30319.18408 built by: FX451RTMGREL
    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/WindowsFormsIntegration/v4.0_4.0.0.0__31bf3856ad364e35/WindowsFormsIntegration.dll
----------------------------------------
AcWindows.resources
    Assembly Version: 19.1.0.0
    Win32 Version: 19.1.18.0.0
    CodeBase: file:///C:/Program%20Files/Autodesk/AutoCAD%202014/en-US/AcWindows.resources.DLL
----------------------------------------
PresentationUI
    Assembly Version: 4.0.0.0
    Win32 Version: 4.0.30319.17929 built by: FX45RTMREL
    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/PresentationUI/v4.0_4.0.0.0__31bf3856ad364e35/PresentationUI.dll
----------------------------------------
System.Xml.Linq
    Assembly Version: 4.0.0.0
    Win32 Version: 4.0.30319.17929 built by: FX45RTMREL
    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Xml.Linq/v4.0_4.0.0.0__b77a5c561934e089/System.Xml.Linq.dll
----------------------------------------
System.Windows.Forms
    Assembly Version: 4.0.0.0
    Win32 Version: 4.0.30319.18408 built by: FX451RTMGREL
    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Windows.Forms/v4.0_4.0.0.0__b77a5c561934e089/System.Windows.Forms.dll
----------------------------------------
PresentationFramework-SystemXmlLinq
    Assembly Version: 4.0.0.0
    Win32 Version: 4.0.30319.17929
    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/PresentationFramework-SystemXmlLinq/v4.0_4.0.0.0__b77a5c561934e089/PresentationFramework-SystemXmlLinq.dll
----------------------------------------
PV3D
    Assembly Version: 1.0.0.0
    Win32 Version: 1.0.0.0
    CodeBase: file:///C:/Users/Fayaz%20Memon/AppData/Roaming/Autodesk/ApplicationPlugins/PV3D.bundle/Contents/PV3D.dll
----------------------------------------
FeaturedAppsPlugin
    Assembly Version: 19.0.0.0
    Win32 Version: 19.0.55.0.0
    CodeBase: file:///C:/ProgramData/Autodesk/ApplicationPlugins/Autodesk%20FeaturedApps.bundle/Contents/Windows/2014/FeaturedAppsPlugin.dll
----------------------------------------
ContextualTabSelectorRules
    Assembly Version: 0.0.0.0
    Win32 Version: 19.1.18.0.0
    CodeBase: file:///C:/Program%20Files/Autodesk/AutoCAD%202014/AcWindows.dll
----------------------------------------
PresentationFramework-SystemCore
    Assembly Version: 4.0.0.0
    Win32 Version: 4.0.30319.17929
    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/PresentationFramework-SystemCore/v4.0_4.0.0.0__b77a5c561934e089/PresentationFramework-SystemCore.dll
----------------------------------------
Microsoft.Expression.Interactions
    Assembly Version: 4.0.0.0
    Win32 Version: 2.0.20520.0
    CodeBase: file:///C:/Program%20Files/Autodesk/AutoCAD%202014/Microsoft.Expression.Interactions.DLL
----------------------------------------
ManagedMC3
    Assembly Version: 7.2.0.0
    Win32 Version: 7.2.0.0
    CodeBase: file:///C:/Program%20Files/Autodesk/AutoCAD%202014/ManagedMC3.DLL
----------------------------------------
UIAutomationTypes
    Assembly Version: 4.0.0.0
    Win32 Version: 4.0.30319.17929 built by: FX45RTMREL
    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/UIAutomationTypes/v4.0_4.0.0.0__31bf3856ad364e35/UIAutomationTypes.dll
----------------------------------------
Microsoft.VisualBasic
    Assembly Version: 10.0.0.0
    Win32 Version: 11.0.50709.17929 built by: FX45RTMREL
    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/Microsoft.VisualBasic/v4.0_10.0.0.0__b03f5f7f11d50a3a/Microsoft.VisualBasic.dll
----------------------------------------
AcLivePreviewContext
    Assembly Version: 0.0.0.0
    Win32 Version: 19.1.18.0.0
    CodeBase: file:///C:/Program%20Files/Autodesk/AutoCAD%202014/AcWindows.dll
----------------------------------------
UIAutomationProvider
    Assembly Version: 4.0.0.0
    Win32 Version: 4.0.30319.17929 built by: FX45RTMREL
    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/UIAutomationProvider/v4.0_4.0.0.0__31bf3856ad364e35/UIAutomationProvider.dll
----------------------------------------
AcLayer
    Assembly Version: 19.1.0.0
    Win32 Version: 19.1.18.0.0
    CodeBase: file:///C:/Program%20Files/Autodesk/AutoCAD%202014/AcLayer.DLL
----------------------------------------
AcLayer.resources
    Assembly Version: 19.1.0.0
    Win32 Version: 19.1.18.0.0
    CodeBase: file:///C:/Program%20Files/Autodesk/AutoCAD%202014/en-US/AcLayer.resources.DLL
----------------------------------------
PresentationFramework.Luna
    Assembly Version: 4.0.0.0
    Win32 Version: 4.0.30319.17929 built by: FX45RTMREL
    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/PresentationFramework.Luna/v4.0_4.0.0.0__31bf3856ad364e35/PresentationFramework.Luna.dll
----------------------------------------
AcMrUi
    Assembly Version: 19.1.0.0
    Win32 Version: 19.1.18.0.0
    CodeBase: file:///C:/Program%20Files/Autodesk/AutoCAD%202014/AcMrUI.DLL
----------------------------------------
AcMrUi.resources
    Assembly Version: 19.1.0.0
    Win32 Version: 19.1.18.0.0
    CodeBase: file:///C:/Program%20Files/Autodesk/AutoCAD%202014/en-US/AcMrUi.resources.DLL
----------------------------------------
AcMr
    Assembly Version: 19.1.0.0
    Win32 Version: 19.1.18.0.0
    CodeBase: file:///C:/Program%20Files/Autodesk/AutoCAD%202014/AcMr.DLL
----------------------------------------
System.Runtime.Serialization
    Assembly Version: 4.0.0.0
    Win32 Version: 4.0.30319.18408 built by: FX451RTMGREL
    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Runtime.Serialization/v4.0_4.0.0.0__b77a5c561934e089/System.Runtime.Serialization.dll
----------------------------------------
FeaturedAppsPlugin.resources
    Assembly Version: 19.0.0.0
    Win32 Version: 19.0.55.0.0
    CodeBase: file:///C:/ProgramData/Autodesk/ApplicationPlugins/Autodesk%20FeaturedApps.bundle/Contents/Resources/en-US/FeaturedAppsPlugin.resources.dll
----------------------------------------
Autodesk.AutoCAD.Interop.Common
    Assembly Version: 19.1.0.0
    Win32 Version: 19.1.18.0.0
    CodeBase: file:///C:/Program%20Files/Autodesk/AutoCAD%202014/Autodesk.AutoCAD.Interop.Common.DLL
----------------------------------------
Autodesk.AutoCAD.Interop
    Assembly Version: 19.1.0.0
    Win32 Version: 19.1.18.0.0
    CodeBase: file:///C:/Program%20Files/Autodesk/AutoCAD%202014/Autodesk.AutoCAD.Interop.DLL
----------------------------------------

************** JIT Debugging **************
Application does not support Windows Forms just-in-time (JIT)
debugging. Contact the application author for more
information.

【问题讨论】:

    标签: vb.net autocad


    【解决方案1】:

    使用 AutoCAD(或任何其他互操作)可能会在开发和生产之间甚至位数(x64 与 x86)之间更改版本号时,最好使用 C# 中的动态(VB 中的对象)而不是使用引用。

    为了在 AutoCAD 中获得准确的属性和方法,您可以创建一个引用 ObjectARX dll 的虚拟项目,然后是一个 CAD 类,该类使用对象(以前的变体和 C# 中的动态)抽象对 AutoCAD 的所有访问。我使用虚拟项目来获取方法和属性的正确拼写,然后将相同的调用应用于我的实际 CAD 项目

    所以要获取我使用的应用程序对象:

    dynamic _application = Marshal.GetActiveObject("AutoCAD.Application");
    dynamic _document = _application.ActiveDocument // Or _application.Documents.Open("...")
    

    VB

    object application = GetObject(, "AutoCAD.Application") ' or CreateObject("AutoCAD.Application"
    object document = application.ActiveDocument ' Or _application.Documents.Open("...")
    

    传递给 GetActiveObject 方法的类 ID:“AutoCAD.Application”将返回 AutoCAD 的活动版本或最后安装的版本。因此,在具有多个版本的机器上,您可以通过在类 ID 中指定版本号来指定所需的版本,如下所示:“AutoCAD.Application.19”。您需要进行一些研究才能知道该数字应该是多少。

    通过在我的 CAD 类中封装我需要的所有 AutoCAD 功能,我可以调用 CAD.Line(....)、CAD.InsertBlock(...)。

    希望这会有所帮助。

    【讨论】:

    • 感谢您的帮助。实际上我安装了两个版本的 AutoCAD(2013 和 2014)。这个问题是由于冲突造成的。
    【解决方案2】:

    如果您不确定哪个 DLL 出现故障,请尝试连接到 AppDomain.AssemblyResolve 事件并逐步执行导致程序集加载的代码。

    如果您正在运行 AutoCAD 2014 的服务包更新,请务必检查您的 ObjectARX SDK 引用是否具有更新的 dll。

    【讨论】:

      猜你喜欢
      • 2011-04-08
      • 1970-01-01
      • 2012-07-13
      • 1970-01-01
      • 2018-10-17
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-05-21
      相关资源
      最近更新 更多