<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: System.MissingMethodException in .NET Forum</title>
    <link>https://forums.autodesk.com/t5/net-forum/system-missingmethodexception/m-p/2158522#M75837</link>
    <description>That is the actual code. I only left out the lines inside the foreach loop. Could the C-style cast be the problem?&lt;BR /&gt;
&lt;BR /&gt;
I'm using VS 2005 and AutoCAD 2006.&lt;BR /&gt;
&lt;BR /&gt;
Database db = new Database(false, true);&lt;BR /&gt;
db.ReadDwgFile(filename, System.IO.FileShare.None, false, null);&lt;BR /&gt;
&lt;BR /&gt;
Transaction tr = db.TransactionManager.StartTransaction();&lt;BR /&gt;
&lt;BR /&gt;
LayerTable lt = (LayerTable)tr.GetObject(db.LayerTableId, OpenMode.ForRead);&lt;BR /&gt;
foreach (ObjectId objID in lt)&lt;BR /&gt;
{&lt;BR /&gt;
.&lt;BR /&gt;
.&lt;BR /&gt;
.&lt;BR /&gt;
}&lt;BR /&gt;
&lt;BR /&gt;
lt.Close();&lt;BR /&gt;
&lt;BR /&gt;
tr.Commit();&lt;BR /&gt;
db.Dispose();</description>
    <pubDate>Fri, 18 Jan 2008 11:56:42 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2008-01-18T11:56:42Z</dc:date>
    <item>
      <title>System.MissingMethodException</title>
      <link>https://forums.autodesk.com/t5/net-forum/system-missingmethodexception/m-p/2158518#M75833</link>
      <description>I am trying to iterate through the layer table and keep getting the following error message:&lt;BR /&gt;
&lt;BR /&gt;
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---&amp;gt; System.MissingMethodException: Method not found: 'Autodesk.AutoCAD.DatabaseServices.SymbolTableEnumerator Autodesk.AutoCAD.DatabaseServices.LayerTable.GetEnumerator()'.&lt;BR /&gt;
   at ClassLibrary.STCClass.test()&lt;BR /&gt;
&lt;BR /&gt;
My code looks like this:&lt;BR /&gt;
&lt;BR /&gt;
Database db = new Database(false, true);&lt;BR /&gt;
db.ReadDwgFile(filename, System.IO.FileShare.None, false, null);&lt;BR /&gt;
&lt;BR /&gt;
Transaction tr = db.TransactionManager.StartTransaction();&lt;BR /&gt;
&lt;BR /&gt;
LayerTable lt = (LayerTable)tr.GetObject(db.LayerTableId, OpenMode.ForRead);&lt;BR /&gt;
foreach (ObjectId objID in lt)&lt;BR /&gt;
{&lt;BR /&gt;
.&lt;BR /&gt;
.&lt;BR /&gt;
.&lt;BR /&gt;
}&lt;BR /&gt;
&lt;BR /&gt;
If I comment our the foreach the error goes away.&lt;BR /&gt;
&lt;BR /&gt;
What am I doing wrong?&lt;BR /&gt;
&lt;BR /&gt;
Thanks,&lt;BR /&gt;
                    lt.Close();&lt;BR /&gt;
&lt;BR /&gt;
                    tr.Commit();&lt;BR /&gt;
                    db.Dispose();</description>
      <pubDate>Thu, 17 Jan 2008 18:49:53 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/system-missingmethodexception/m-p/2158518#M75833</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2008-01-17T18:49:53Z</dc:date>
    </item>
    <item>
      <title>Re: System.MissingMethodException</title>
      <link>https://forums.autodesk.com/t5/net-forum/system-missingmethodexception/m-p/2158519#M75834</link>
      <description>You're not showing the actual code, because what you&lt;BR /&gt;
show would fail at the call to GetObject(), because you're &lt;BR /&gt;
not casting the result to a LayerTable.&lt;BR /&gt;
&lt;BR /&gt;
Also, what release of AutoCAD are you using?&lt;BR /&gt;
&lt;BR /&gt;
-- &lt;BR /&gt;
http://www.caddzone.com&lt;BR /&gt;
&lt;BR /&gt;
AcadXTabs: MDI Document Tabs for AutoCAD 2008&lt;BR /&gt;
Supporting AutoCAD 2000 through 2008&lt;BR /&gt;
http://www.acadxtabs.com&lt;BR /&gt;
&lt;BR /&gt;
&lt;JPRISBE&gt; wrote in message news:5823542@discussion.autodesk.com...&lt;BR /&gt;
I am trying to iterate through the layer table and keep getting the following error message:&lt;BR /&gt;
&lt;BR /&gt;
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---&amp;gt; System.MissingMethodException: Method not found: 'Autodesk.AutoCAD.DatabaseServices.SymbolTableEnumerator Autodesk.AutoCAD.DatabaseServices.LayerTable.GetEnumerator()'.&lt;BR /&gt;
   at ClassLibrary.STCClass.test()&lt;BR /&gt;
&lt;BR /&gt;
My code looks like this:&lt;BR /&gt;
&lt;BR /&gt;
Database db = new Database(false, true);&lt;BR /&gt;
db.ReadDwgFile(filename, System.IO.FileShare.None, false, null);&lt;BR /&gt;
&lt;BR /&gt;
Transaction tr = db.TransactionManager.StartTransaction();&lt;BR /&gt;
&lt;BR /&gt;
LayerTable lt = (LayerTable)tr.GetObject(db.LayerTableId, OpenMode.ForRead);&lt;BR /&gt;
foreach (ObjectId objID in lt)&lt;BR /&gt;
{&lt;BR /&gt;
.&lt;BR /&gt;
.&lt;BR /&gt;
.&lt;BR /&gt;
}&lt;BR /&gt;
&lt;BR /&gt;
If I comment our the foreach the error goes away.&lt;BR /&gt;
&lt;BR /&gt;
What am I doing wrong?&lt;BR /&gt;
&lt;BR /&gt;
Thanks,&lt;BR /&gt;
                    lt.Close();&lt;BR /&gt;
&lt;BR /&gt;
                    tr.Commit();&lt;BR /&gt;
                    db.Dispose();&lt;/JPRISBE&gt;</description>
      <pubDate>Thu, 17 Jan 2008 22:07:41 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/system-missingmethodexception/m-p/2158519#M75834</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2008-01-17T22:07:41Z</dc:date>
    </item>
    <item>
      <title>Re: System.MissingMethodException</title>
      <link>https://forums.autodesk.com/t5/net-forum/system-missingmethodexception/m-p/2158520#M75835</link>
      <description>Looks like a c style cast to me ??</description>
      <pubDate>Fri, 18 Jan 2008 01:59:21 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/system-missingmethodexception/m-p/2158520#M75835</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2008-01-18T01:59:21Z</dc:date>
    </item>
    <item>
      <title>Re: System.MissingMethodException</title>
      <link>https://forums.autodesk.com/t5/net-forum/system-missingmethodexception/m-p/2158521#M75836</link>
      <description>Hi Dan, you're right, I missed it &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;BR /&gt;
&lt;BR /&gt;
But, there is still something fishy because it works fine here.&lt;BR /&gt;
&lt;BR /&gt;
And that's why I don't think he's showing the actual code.&lt;BR /&gt;
&lt;BR /&gt;
-- &lt;BR /&gt;
http://www.caddzone.com&lt;BR /&gt;
&lt;BR /&gt;
AcadXTabs: MDI Document Tabs for AutoCAD 2008&lt;BR /&gt;
Supporting AutoCAD 2000 through 2008&lt;BR /&gt;
http://www.acadxtabs.com&lt;BR /&gt;
&lt;BR /&gt;
&lt;DANIELM&gt; wrote in message news:5823985@discussion.autodesk.com...&lt;BR /&gt;
Looks like a c style cast to me ??&lt;/DANIELM&gt;</description>
      <pubDate>Fri, 18 Jan 2008 09:33:51 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/system-missingmethodexception/m-p/2158521#M75836</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2008-01-18T09:33:51Z</dc:date>
    </item>
    <item>
      <title>Re: System.MissingMethodException</title>
      <link>https://forums.autodesk.com/t5/net-forum/system-missingmethodexception/m-p/2158522#M75837</link>
      <description>That is the actual code. I only left out the lines inside the foreach loop. Could the C-style cast be the problem?&lt;BR /&gt;
&lt;BR /&gt;
I'm using VS 2005 and AutoCAD 2006.&lt;BR /&gt;
&lt;BR /&gt;
Database db = new Database(false, true);&lt;BR /&gt;
db.ReadDwgFile(filename, System.IO.FileShare.None, false, null);&lt;BR /&gt;
&lt;BR /&gt;
Transaction tr = db.TransactionManager.StartTransaction();&lt;BR /&gt;
&lt;BR /&gt;
LayerTable lt = (LayerTable)tr.GetObject(db.LayerTableId, OpenMode.ForRead);&lt;BR /&gt;
foreach (ObjectId objID in lt)&lt;BR /&gt;
{&lt;BR /&gt;
.&lt;BR /&gt;
.&lt;BR /&gt;
.&lt;BR /&gt;
}&lt;BR /&gt;
&lt;BR /&gt;
lt.Close();&lt;BR /&gt;
&lt;BR /&gt;
tr.Commit();&lt;BR /&gt;
db.Dispose();</description>
      <pubDate>Fri, 18 Jan 2008 11:56:42 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/system-missingmethodexception/m-p/2158522#M75837</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2008-01-18T11:56:42Z</dc:date>
    </item>
    <item>
      <title>Re: System.MissingMethodException</title>
      <link>https://forums.autodesk.com/t5/net-forum/system-missingmethodexception/m-p/2158523#M75838</link>
      <description>Works in AutoCAD 2007.</description>
      <pubDate>Fri, 18 Jan 2008 13:04:01 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/system-missingmethodexception/m-p/2158523#M75838</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2008-01-18T13:04:01Z</dc:date>
    </item>
    <item>
      <title>Re: System.MissingMethodException</title>
      <link>https://forums.autodesk.com/t5/net-forum/system-missingmethodexception/m-p/2158524#M75839</link>
      <description>You are referencing wrong versions of the&lt;BR /&gt;
managed assemblies for AutoCAD 2006.&lt;BR /&gt;
&lt;BR /&gt;
If you're thinking that you can use the same&lt;BR /&gt;
.NET dll in both of those releases, you can't,&lt;BR /&gt;
&lt;BR /&gt;
-- &lt;BR /&gt;
http://www.caddzone.com&lt;BR /&gt;
&lt;BR /&gt;
AcadXTabs: MDI Document Tabs for AutoCAD 2008&lt;BR /&gt;
Supporting AutoCAD 2000 through 2008&lt;BR /&gt;
http://www.acadxtabs.com&lt;BR /&gt;
&lt;BR /&gt;
&lt;JPRISBE&gt; wrote in message news:5824195@discussion.autodesk.com...&lt;BR /&gt;
Works in AutoCAD 2007.&lt;/JPRISBE&gt;</description>
      <pubDate>Fri, 18 Jan 2008 15:44:55 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/system-missingmethodexception/m-p/2158524#M75839</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2008-01-18T15:44:55Z</dc:date>
    </item>
    <item>
      <title>Re: System.MissingMethodException</title>
      <link>https://forums.autodesk.com/t5/net-forum/system-missingmethodexception/m-p/2158525#M75840</link>
      <description>No... I just need it to work in one or the other.&lt;BR /&gt;
Thanks for the heads-up though.</description>
      <pubDate>Fri, 18 Jan 2008 15:51:04 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/system-missingmethodexception/m-p/2158525#M75840</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2008-01-18T15:51:04Z</dc:date>
    </item>
  </channel>
</rss>

