2014-04-25 72 views
0

我使用ObjectARX 2013在vb.net 2013 for AutoCAD 2013中創建了classLibrary dll。它在AutoCAD 2013 32bit中正常工作& 64位(winxp, win7,win8)。我爲AutoCAD 2014複製的同一個程序和使用ObjectARX 2014的庫。但是,當我在AutoCAD 2014中運行時出現此錯誤。AutoCAD 2014:System.Runtime.InteropServices.COMException(0x80029C4A)(TYPE_E_CANTLOADLIBRARY))

請幫助我。我該怎麼辦?

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. 

回答

1

使用AutoCAD(或任何其他互操作性),可能會更改開發和生產之間的版本號或甚至位(x64與x86)時,最好在C#中使用動態(VB中的對象),而不要使用引用。

爲了在AutoCAD中具有準確的屬性和方法,您可以引用ObjectARX dll的虛擬項目,然後使用對象(以前的變體和C#中的動態效果)提取對AutoCAD的所有訪問權限的CAD類。我用的是虛擬項目,獲得的方法和屬性的正確拼寫,然後同樣調用適用於我的實際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(...)。

希望這會有所幫助。

+0

感謝您的幫助。 其實我安裝了兩個版本的AutoCAD(2013&2014)。這個問題是由於衝突。 – user3573690

0

如果你不知道什麼DLL失敗,嘗試掛接到AppDomain.AssemblyResolve事件,並通過使組件加載代碼步驟。

另外,請務必檢查您是否正在運行Service Pack的Service Pack更新,您的ObjectARX SDK引用的更新dll。

相關問題