AutoCAD 2014:System.Runtime.InteropServices.COMException(0x80029C4A)(TYPE_E_CANTLOADLIBRARY))

时间:2014-04-25 16:27:19

标签: vb.net autocad

我使用ObjectARX 2013在vb.net 2013中为AutoCAD 2013创建了classLibrary dll。它在AutoCAD 2013 32bit& 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.

2 个答案:

答案 0 :(得分:1)

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

为了在AutoCAD中获得准确的属性和方法,您可以使用引用ObjectARX dll的虚拟项目,然后使用对象(以前的变体和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(...)。

希望这有帮助。

答案 1 :(得分:0)

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

另外一定要检查,如果您正在运行AutoCAD 2014的Service Pack更新,那么您的ObjectARX SDK引用了更新的dll。