<?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: COM Interoperability application not running in other computer. in .NET Forum</title>
    <link>https://forums.autodesk.com/t5/net-forum/com-interoperability-application-not-running-in-other-computer/m-p/7424337#M29604</link>
    <description>&lt;P&gt;How can i use late binding??&lt;/P&gt;</description>
    <pubDate>Mon, 02 Oct 2017 07:26:15 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2017-10-02T07:26:15Z</dc:date>
    <item>
      <title>COM Interoperability application not running in other computer.</title>
      <link>https://forums.autodesk.com/t5/net-forum/com-interoperability-application-not-running-in-other-computer/m-p/7385806#M29600</link>
      <description>&lt;P&gt;I create a application with VS2015 that using&amp;nbsp;COM Interoperability. It working correctly in my computre but when i copy debug folder and run application , while application wants to drawing object in autocad occure exeption error. i create &amp;nbsp;a setup file with VS2015 but its not working.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;this is my cad connection:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;using System.Runtime.InteropServices;
CadeConnection
    {
        public dynamic Connect()
        {
            string progId = "AutoCAD.Application";
            dynamic acadApp;
            try
            {
                acadApp = Marshal.GetActiveObject(progId);
            }
            catch
            {
                acadApp = Activator.CreateInstance(Type.GetTypeFromProgID(progId));
            }
            while (true)
            {
                try
                {
                    acadApp.Visible = true;
                    break;
                }
                catch { }
            }
            return acadApp;         
        }
}&lt;/PRE&gt;&lt;P&gt;And i use it like this :&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;using Autodesk.AutoCAD.Interop.Common;
class DrawInAutocade
    {
        CadeConnection connection = new CadeConnection();
        public void Line(double[] Point1, double[] Point2, string LayerName)
        {
            AcadLine Line = default(AcadLine);
            Line = connection.Connect().ActiveDocument.ModelSpace.AddLine(Point1, Point2);
            Line.Layer = LayerName;   
        }
}&lt;/PRE&gt;&lt;P&gt;why introp.common and introp files &amp;nbsp;is not existing &amp;nbsp;in debug folder of VS2015 ???&lt;/P&gt;</description>
      <pubDate>Sun, 17 Sep 2017 07:46:04 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/com-interoperability-application-not-running-in-other-computer/m-p/7385806#M29600</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-09-17T07:46:04Z</dc:date>
    </item>
    <item>
      <title>Re: COM Interoperability application not running in other computer.</title>
      <link>https://forums.autodesk.com/t5/net-forum/com-interoperability-application-not-running-in-other-computer/m-p/7416253#M29601</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This is probably a version compatibility issue.&lt;/P&gt;
&lt;P&gt;AutoCAD.Interop libraries may not be version compatible.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;These libraries aren't copied in the Debug folder because you cannot set the Copy locale proerty to true. AutoCAD find them in the Global Assembly Cache.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you really cannot avoid using the COM API, you can try to remove the references to the interop libraries and use late binding with the dynamic type.&lt;/P&gt;</description>
      <pubDate>Thu, 28 Sep 2017 09:28:05 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/com-interoperability-application-not-running-in-other-computer/m-p/7416253#M29601</guid>
      <dc:creator>_gile</dc:creator>
      <dc:date>2017-09-28T09:28:05Z</dc:date>
    </item>
    <item>
      <title>Re: COM Interoperability application not running in other computer.</title>
      <link>https://forums.autodesk.com/t5/net-forum/com-interoperability-application-not-running-in-other-computer/m-p/7416887#M29602</link>
      <description>&lt;P&gt;To _gile,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;slight correction: AutoCAD installation no longer places its .NET interop assemlies (Autodesk.AutoCAD.Interop.dll and Autodesk.AutoCAD.Interop.Common.dll) into GAC since AutoCAD2013(or 2014?). They are in AutoCAD installation folder.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;To OP,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Firstly as _gile pointed out, you need to make sure it is not version compatibility issue. That is, the other computer has the same version of AutoCAD version (or newer).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also, since you mention that the interop DLLs are not in the "Debug" folder, then it is either expected, or wrong, depending how you add interop references to your project.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;As aforementioned, if you add references to Autodesk.AutoCAD.Interop/Common.dll in AutoCAD installation folder (or from ObjectARX SDK download folder), you do not include the interop DLLS in your project's output (set "Copy Local" to False), because AutoCAD has these 2 DLLs in its installation folder.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;However, if you add AutoCAD COM references from "Add References" dialog -&amp;gt; COM tab, and select "AutoCAD 201x type library/Common library", then Visual Studio will use tlbImport.exe to generate corresponding interop DLLs. In this case, you MUST include the interop DLLs in the project's output (Copy Local" set to True).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also, since VS2012, when adding COM interop reference, VS automatically embed COM interop dll as resources in the project. It works OK with MS Offce interop DLLs, but not with AutoCAD's interop DLLs. You need to make sure "Embed Interop Types" is set False.&lt;/P&gt;</description>
      <pubDate>Thu, 28 Sep 2017 13:37:23 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/com-interoperability-application-not-running-in-other-computer/m-p/7416887#M29602</guid>
      <dc:creator>norman.yuan</dc:creator>
      <dc:date>2017-09-28T13:37:23Z</dc:date>
    </item>
    <item>
      <title>Re: COM Interoperability application not running in other computer.</title>
      <link>https://forums.autodesk.com/t5/net-forum/com-interoperability-application-not-running-in-other-computer/m-p/7424335#M29603</link>
      <description>&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;I am sure its&amp;nbsp;&lt;SPAN&gt;version compatibility issue. But i am not know how solve it.&amp;nbsp; I want that my application working correctly with all AutoCAD version.&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;&lt;SPAN&gt;In my computer i using VS2015 and AutoCAD2018 and i refrenced&amp;nbsp;&amp;nbsp;Autodesk.AutoCAD.Interop.dll and Autodesk.AutoCAD.Interop.Common.dll&amp;nbsp;from installation folder of AutoCAD 2018.&amp;nbsp;It works well only with AutoCAD2018 in this case. How refrenced&amp;nbsp;Autodesk.AutoCAD.Interop.dll and Autodesk.AutoCAD.Interop.Common.dll that my application working with all version???&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 02 Oct 2017 07:24:21 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/com-interoperability-application-not-running-in-other-computer/m-p/7424335#M29603</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-10-02T07:24:21Z</dc:date>
    </item>
    <item>
      <title>Re: COM Interoperability application not running in other computer.</title>
      <link>https://forums.autodesk.com/t5/net-forum/com-interoperability-application-not-running-in-other-computer/m-p/7424337#M29604</link>
      <description>&lt;P&gt;How can i use late binding??&lt;/P&gt;</description>
      <pubDate>Mon, 02 Oct 2017 07:26:15 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/com-interoperability-application-not-running-in-other-computer/m-p/7424337#M29604</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-10-02T07:26:15Z</dc:date>
    </item>
    <item>
      <title>Re: COM Interoperability application not running in other computer.</title>
      <link>https://forums.autodesk.com/t5/net-forum/com-interoperability-application-not-running-in-other-computer/m-p/7424685#M29605</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;seyyed.reza.10 a écrit&amp;nbsp;:&lt;BR /&gt;
&lt;P&gt;How can i use late binding??&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;while you do not use variants, it can be quite easy : when you think you code works as expected, remove all reference to the COM libraries and replace the COM types in the code with 'dynamic' type (you may also have to replace the COM enum values with their equivalent integer).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;class DrawInAutocade
{
    CadeConnection connection = new CadeConnection();&lt;BR /&gt;
    public void Line(double[] Point1, double[] Point2, string LayerName)
    {
        dynamic line = connection.Connect().ActiveDocument.ModelSpace.AddLine(Point1, Point2);
        line.Layer = LayerName;   
    }&lt;BR /&gt;}&lt;/PRE&gt;
&lt;P&gt;But, in my opinion, the first question you have to ask yourself is : "Do I absolutely use the COM API, can't I use the .NET API instead?".&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you absolutely need to use COM API (i.e. you must build a standalone application), you can also:&lt;/P&gt;
&lt;P&gt;- create some custom commands with the .NET API generating a DLL&lt;/P&gt;
&lt;P&gt;- get the AutoCAD application from the standalone exe, then load the DLL and the call the commands as shown &lt;A href="http://help.autodesk.com/view/OARX/2018/FRA/?guid=GUID-C8C65D7A-EC3A-42D8-BF02-4B13C2EA1A4B" target="_blank"&gt;here&lt;/A&gt;.&lt;/P&gt;</description>
      <pubDate>Mon, 02 Oct 2017 09:51:28 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/com-interoperability-application-not-running-in-other-computer/m-p/7424685#M29605</guid>
      <dc:creator>_gile</dc:creator>
      <dc:date>2017-10-02T09:51:28Z</dc:date>
    </item>
  </channel>
</rss>

