An unhandled exception of type 'System.Runtime.InteropServices.COMException'

I am trying to get some block info from an Autocad drawing using vb.net.
It was working fine with autocad 2005.When we upgraded to autocad 2006, it is crashing.
The first one is having problem is in the line
Dim CurrentSpace As String
CurrentSpace = AppObj.ActiveDocument.ActiveLayout.Block.Name '  
          This is returning >> "*Paper_Space"

For I = 0 To AppObj.ActiveDocument.Blocks.Count – 1    ‘ERROR IS HERE ’
Where Friend WithEvents AppObj As Autodesk.AutoCAD.Interop.AcadApplication
The error is
An unhandled exception of type 'System.Runtime.InteropServices.COMException' occurred in DrawingIndexer.exe

Additional information: No database

If I look in the quick watch window for AppObj.ActiveDocument.Blocks this is the error
Blocks      <error: an exception of type: {System.Runtime.InteropServices.COMException} occurred>
Type:      Autodesk.AutoCAD.Interop.Common.AcadBlocks
aio419Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Bob LearnedCommented:
Did you readd the reference to the Autocad, or are you using the same wrapper class?

Bob
0
aio419Author Commented:
Yes,I readded the references. (named Autocad 2006 Type Library and AxdbLib.(16.0) type library)
from the COM tab

0
Bob LearnedCommented:
Ok, so the developers have changed the interface for the type library, and you need to figure out how.  I don't know what that would be exactly.

Bob
0
Cloud Class® Course: Microsoft Azure 2017

Azure has a changed a lot since it was originally introduce by adding new services and features. Do you know everything you need to about Azure? This course will teach you about the Azure App Service, monitoring and application insights, DevOps, and Team Services.

aio419Author Commented:
Thanks for the reply.
I trying to find out why it is not working for acad 2006  with
AppObj.ActiveDocument.Blocks.Count  giving no database error.

Do i need to add any other references or is there any change for Acad 2006 for this.
0
Bob LearnedCommented:
The type libraries for 2006 have been renamed, so did you add a reference to the new name?  Do you still have 2005 installed?

Bob
0
Bob LearnedCommented:
The Autocad 2006 CD has documentation and samples that might help explain your problems.

Bob
0
aio419Author Commented:
i do not have 2005 installed. I removed the reference for 2005 and added 2006 references.
0
Bob LearnedCommented:
I am out of ideas.

Bob
0
aio419Author Commented:
After a struggle I figured out that it is a bug in Autocad and got a hot fix them to patch it.
It is working now.
Thanks for your replay though.
0
GranModCommented:
Closed, 35 points refunded.
GranMod
The Experts Exchange
Community Support Moderator of all Ages
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic.NET

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.