Community
Navisworks API
Welcome to Autodesk’s Navisworks API Forums. Share your knowledge, ask questions, and explore popular Navisworks API topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Error when terminating API

3 REPLIES 3
Reply
Message 1 of 4
JohnHon
422 Views, 3 Replies

Error when terminating API

Dear all,

 

I am writing a window form application.

When I terminate the api, there will be an error that cannot be catch with try-catch in C#.

Does anyone know the reasons and how to fix it?

 

Code:

if (Autodesk.Navisworks.Api.Controls.ApplicationControl.IsInitialized)
Autodesk.Navisworks.Api.Controls.ApplicationControl.Terminate();

 

Error:

Message:Attempted to read or write protected memory. This is often an indication that other memory is corrupt.

Stack trace: 

at Autodesk.Navisworks.Api.Interop.LcOpState.InternalCleanup(Boolean queue)
at Autodesk.Navisworks.Internal.ApiImplementation.Manager.Invalidate()
at Autodesk.Navisworks.Internal.ApiImplementation.ApplicationImpl.TerminateApi()
at Autodesk.Navisworks.Api.Controls.ApplicationControl.TerminateImpl()
at MDIViewer.Program.Main() in D:\......\Program.cs:line 225
at System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()

 

Thanks,

John

3 REPLIES 3
Message 2 of 4
xiaodong_liang
in reply to: JohnHon

Hi John,

this is a mysterious issue to me. Can the SDK sample of .NET control work? if yes, could you compare it with your sample?

if you still have the problem, please provide a test demo.
Message 3 of 4
JohnHon
in reply to: xiaodong_liang

Hi Xiaodong,

 

I am sorry that I cannot trigger that error in SDK or MDI viewer.

I will try to provide a test model, but I am not sure I can produce it.

 

Thanks,

John

Message 4 of 4
xiaodong_liang
in reply to: JohnHon

I 'd suggest to compare the project setting to figure out which one may cause the problem.

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Rail Community


 

Autodesk Design & Make Report