<?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: ComException was unhandled in .NET Forum</title>
    <link>https://forums.autodesk.com/t5/net-forum/comexception-was-unhandled/m-p/5247373#M42778</link>
    <description>&lt;P&gt;Your code looks OK.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I did tests with an exe that automate AutoCAD and draw a polyline in model space, with both AutoCAD2012 and AutoCAD2015. What I found is that this issue only occurs with my AutoCAD 2015 when running the code from VS for debugging. That is, if I start the EXE from VS debugging, then the code&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;AcadDocument.ModelSpace.AddPolyline(...)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;raises the error. Interestingly, if I place a break point at the line of code and when the break point is hit and I let the code continue (F10/11), no error at all, the polyline is created successfully. Also, of I run the code with AutoCAD2015 without debugging (i.e. running the EXE normally), again, no error at all and the polyline created correctly.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Using the same code with AutoCAD2012, no problem, in debugging mode or not.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So, it looks like the issue is probably started with AutoCAd2013 when the big separation of AutoCAD core with Acad.exe and the 64bit AutoCAD and 32-bit VS debugging process may be the root of the issue.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Anyway, it looks like a pure issue of the debugging because of the tool (Visual Studio). As AutoCAD customization programmers, we used to a quite some debugging difficulties over the years and this may just be one of them.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 02 Sep 2014 15:54:18 GMT</pubDate>
    <dc:creator>norman.yuan</dc:creator>
    <dc:date>2014-09-02T15:54:18Z</dc:date>
    <item>
      <title>ComException was unhandled</title>
      <link>https://forums.autodesk.com/t5/net-forum/comexception-was-unhandled/m-p/5245245#M42777</link>
      <description>&lt;P&gt;Hi to all!!!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have this problem running an app with &lt;A rel="nofollow" target="_blank" href="http://vb.net"&gt;vb.net&lt;/A&gt; 2010 and autocad 2014, this app was developunderf vb6 and autocad 2002 and I made little changes to make it work with autocad 2014 using &lt;A rel="nofollow" target="_blank" href="http://vb.net"&gt;vb.net&lt;/A&gt; 2010 but keeps this error i tried to figure out but still the error,&lt;/P&gt;&lt;P&gt;Can you help me with this?&lt;/P&gt;&lt;P&gt;this is the code:&lt;/P&gt;&lt;P&gt;Dim dpuntos(0 To 11) As Double&lt;/P&gt;&lt;P&gt;dpuntos(0) = 0 : dpuntos(1) = 0 : dpuntos(2) = 0&lt;BR /&gt;dpuntos(3) = CType(txtTankD.Text, Double) : dpuntos(4) = 0 : dpuntos(5) = 0&lt;BR /&gt;dpuntos(6) = CType(txtTankD.Text, Double) : dpuntos(7) = CType(txtOilLevel.Text, Double) : dpuntos(8) = 0&lt;BR /&gt;dpuntos(9) = 0 : dpuntos(10) = CType(txtOilLevel.Text, Double) : dpuntos(11) = 0&lt;/P&gt;&lt;P&gt;acuadro = adDibujo.ModelSpace.AddPolyline(dpuntos)&lt;BR /&gt;acuadro.Closed = True&lt;/P&gt;&lt;P&gt;and it crash on acuadro= adDibujo.modelspace.addpolyline(dpuntos)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can someone take a look and help me?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for your reply.&lt;/P&gt;</description>
      <pubDate>Mon, 01 Sep 2014 13:56:30 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/comexception-was-unhandled/m-p/5245245#M42777</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2014-09-01T13:56:30Z</dc:date>
    </item>
    <item>
      <title>Re: ComException was unhandled</title>
      <link>https://forums.autodesk.com/t5/net-forum/comexception-was-unhandled/m-p/5247373#M42778</link>
      <description>&lt;P&gt;Your code looks OK.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I did tests with an exe that automate AutoCAD and draw a polyline in model space, with both AutoCAD2012 and AutoCAD2015. What I found is that this issue only occurs with my AutoCAD 2015 when running the code from VS for debugging. That is, if I start the EXE from VS debugging, then the code&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;AcadDocument.ModelSpace.AddPolyline(...)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;raises the error. Interestingly, if I place a break point at the line of code and when the break point is hit and I let the code continue (F10/11), no error at all, the polyline is created successfully. Also, of I run the code with AutoCAD2015 without debugging (i.e. running the EXE normally), again, no error at all and the polyline created correctly.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Using the same code with AutoCAD2012, no problem, in debugging mode or not.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So, it looks like the issue is probably started with AutoCAd2013 when the big separation of AutoCAD core with Acad.exe and the 64bit AutoCAD and 32-bit VS debugging process may be the root of the issue.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Anyway, it looks like a pure issue of the debugging because of the tool (Visual Studio). As AutoCAD customization programmers, we used to a quite some debugging difficulties over the years and this may just be one of them.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 02 Sep 2014 15:54:18 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/comexception-was-unhandled/m-p/5247373#M42778</guid>
      <dc:creator>norman.yuan</dc:creator>
      <dc:date>2014-09-02T15:54:18Z</dc:date>
    </item>
    <item>
      <title>Re: ComException was unhandled</title>
      <link>https://forums.autodesk.com/t5/net-forum/comexception-was-unhandled/m-p/5262293#M42779</link>
      <description>&lt;P&gt;Thank you for your Reply,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Yes I was testing this issue, like you said, if I put break points and then continue debbuging with F10 or F5, this continue with no problem, also this happend in all after the line ADDpoliline, or ADD something, and I put a Thread sleep, it works for the first 5 times, but the issue came up again, I'm almost finish the proyect to generate the .exe and make sure this not happen again, but on the mean time i think this is a temporally solution.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks, if I have another problem I keep you inform.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 09 Sep 2014 13:18:46 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/comexception-was-unhandled/m-p/5262293#M42779</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2014-09-09T13:18:46Z</dc:date>
    </item>
  </channel>
</rss>

