I have a .net application that works with the survey database. I have to use COM methods to access it. I have multiple versions of Civil 3D on my machine (2020 and 2022) and I am getting an error when other versions of Civil 3d are open and I try to run the command. If a single version is opened, the command works as expected. I use different .dlls (with the appropriate application versions) with each Civil 3d version used.
If oAcadApp Is Nothing Then
oAcadApp = GetObject(, "AutoCAD.Application")
'get survey application
oAeccSurveyApp = oAcadApp.GetInterfaceObject("AeccXUiSurvey.AeccSurveyApplication.13.4")
If oAeccSurveyApp Is Nothing Then
ed.WriteMessage(vbCrLf + "Command must me run in Civil 3d. ")
Else
oAeccSurveyDB = oAeccSurveyApp.ActiveDocument.Database
End If
End If
The error messages are:
Application does not support just-in-time (JIT)
debugging. See the end of this message for details.
************** Exception Text **************
System.IO.FileNotFoundException: Problem in loading application
at Microsoft.VisualBasic.CompilerServices.LateBinding.LateGet(Object o, Type objType, String name, Object[] args, String[] paramnames, Boolean[] CopyBack)
at Microsoft.VisualBasic.CompilerServices.NewLateBinding.LateGet(Object Instance, Type Type, String MemberName, Object[] Arguments, String[] ArgumentNames, Type[] TypeArguments, Boolean[] CopyBack)
at KHA.KHA.ExtractLineworkFromSurveyFigures2.cmdExtractFigureLinework()
at Autodesk.AutoCAD.Runtime.CommandClass.InvokeWorker(MethodInfo mi, Object commandObject, Boolean bLispFunction)
at Autodesk.AutoCAD.Runtime.CommandClass.InvokeWorkerWithExceptionFilter(MethodInfo mi, Object commandObject, Boolean bLispFunction)
at Autodesk.AutoCAD.Runtime.PerDocumentCommandClass.Invoke(MethodInfo mi, Boolean bLispFunction)
at Autodesk.AutoCAD.Runtime.CommandClass.CommandThunk.Invoke()
and after the next run:
Application does not support just-in-time (JIT)
debugging. See the end of this message for details.
************** Exception Text **************
System.NullReferenceException: Object reference not set to an instance of an object.
at Autodesk.AutoCAD.Runtime.Interop.CheckNull(IntPtr returnValue)
at Autodesk.AutoCAD.ApplicationServices.TransactionManager.StartTransaction()
at KHA.KHA.ExtractLineworkFromSurveyFigures2.cmdExtractFigureLinework()
at Autodesk.AutoCAD.Runtime.CommandClass.InvokeWorker(MethodInfo mi, Object commandObject, Boolean bLispFunction)
at Autodesk.AutoCAD.Runtime.CommandClass.InvokeWorkerWithExceptionFilter(MethodInfo mi, Object commandObject, Boolean bLispFunction)
at Autodesk.AutoCAD.Runtime.PerDocumentCommandClass.Invoke(MethodInfo mi, Boolean bLispFunction)
at Autodesk.AutoCAD.Runtime.CommandClass.CommandThunk.Invoke()
Any help would be appreciated.
Thank you,
Stacy