<?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: RegAsm cannot find dependent library when registering a DLL in .NET Forum</title>
    <link>https://forums.autodesk.com/t5/net-forum/regasm-cannot-find-dependent-library-when-registering-a-dll/m-p/7224746#M30850</link>
    <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;@Anonymous wrote:&lt;BR /&gt;&lt;P&gt;So, let me make sure I am clear on the order of events that need to happen:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;1) Develop my .NET dll to replace GeAuto.dll&lt;/P&gt;&lt;P&gt;2) Do a one-time netload of the dll and run a command defined therein to register the assembly for COM (MyLib.GeAuto)&lt;/P&gt;&lt;P&gt;3) Thereafter, I will not need to netload the dll&lt;/P&gt;&lt;P&gt;4) Instead my VBA code will call something like&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;Dim MyGeAuto as MyLib.GeAuto&lt;/P&gt;&lt;P&gt;&amp;nbsp; Set MyGeAuto = AcadApplication.GetInterfaceObject(MyLib.GeAuto)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Does that sound about right?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Yes, except that you don't need to define a command to register the DLL, you can just do it in the IExtensionApplication.Initialize() method, which is called when the assembly is NETLOADed.&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 13 Jul 2017 06:24:09 GMT</pubDate>
    <dc:creator>ActivistInvestor</dc:creator>
    <dc:date>2017-07-13T06:24:09Z</dc:date>
    <item>
      <title>RegAsm cannot find dependent library when registering a DLL</title>
      <link>https://forums.autodesk.com/t5/net-forum/regasm-cannot-find-dependent-library-when-registering-a-dll/m-p/7176611#M30840</link>
      <description>&lt;P&gt;Trying to update an old VBA application - without rewriting the whole thing - which has a dependency on two libraries from AutoCAD Mechanical 2007 (GeAuto.dll and BrepAuto.dll). &amp;nbsp;I thought I would just write some COM visible .NET dlls and replace the calls to the original libraries with the .NET components that do the same work. &amp;nbsp;Probably not exactly that simple, but that is the idea. &amp;nbsp;Anyway, starting simple, I created my replacement for GeAuto &amp;nbsp;and put in a class called GePoint that will implement whatever methods I need, but use an encapsulated&amp;nbsp;Autodesk.AutoCAD.Geometry.Point3d as a delegate for doing the actual work. &amp;nbsp;Now, when I run RegAsm.exe, I get an error message like below and I don't know what to do next. &amp;nbsp;I am including the command line in case I'm doing something wrong with that as well. &amp;nbsp;Curiously, while I get the error when using Point3d or Vector3d, I do NOT get it when using&amp;nbsp;CompositeCurve2d. &amp;nbsp;I have tried setting CopyLocal to True for all of the referenced AutoCAD assemblies, but no change.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;C:\Windows\Microsoft.NET\Framework\v4.0.30319\RegAsm.exe /codebase /tlb:C:\UDir\0Dev\Projects2012\GEAuto\GEAuto\bin\Debug\\GEAuto.tlb C:\UDi&lt;BR /&gt;r\0Dev\Projects2012\GEAuto\GEAuto\bin\Debug\\GEAuto.dll&lt;BR /&gt;Microsoft .NET Framework Assembly Registration Utility version 4.0.30319.34209&lt;BR /&gt;for Microsoft .NET Framework version 4.0.30319.34209&lt;BR /&gt;Copyright (C) Microsoft Corporation. All rights reserved.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;RegAsm : warning RA0000 : Registering an unsigned assembly with /codebase can cause your assembly to interfere with other applications that may be installed onthe same computer. The /codebase switch is intended to be used only with signed assemblies. Please give your assembly a strong name and re-register it.&lt;BR /&gt;RegAsm : error RA0000 : Could not load file or assembly 'Acdbmgd, Version=20.1.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. An attempt&lt;BR /&gt;was made to load a program with an incorrect format.&lt;/P&gt;</description>
      <pubDate>Sun, 25 Jun 2017 02:27:47 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/regasm-cannot-find-dependent-library-when-registering-a-dll/m-p/7176611#M30840</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-06-25T02:27:47Z</dc:date>
    </item>
    <item>
      <title>Re: RegAsm cannot find dependent library when registering a DLL</title>
      <link>https://forums.autodesk.com/t5/net-forum/regasm-cannot-find-dependent-library-when-registering-a-dll/m-p/7176640#M30841</link>
      <description>&lt;P&gt;OK, I guess, unlike StackOverflow, this forum does NOT allow you to edit an existing post so I'll have to reply to myself to correct something in the original post. &amp;nbsp;Seems like an inefficient use of everybody's time... &amp;nbsp;The command line should have been as below - no double '\'s. &amp;nbsp;I just named my new dlls, the namespace, and the classes like they were in the original ACADM 2007 libraries because the VBA IDE doesn't have as nice a facility for renaming variables and types, or reporting errors as VS2012.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;C:\Windows\Microsoft.NET\Framework\v4.0.30319\RegAsm.exe /codebase /tlb:.\GEAuto.tlb .&lt;/SPAN&gt;&lt;SPAN&gt;\GEAuto.dll&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 25 Jun 2017 03:22:49 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/regasm-cannot-find-dependent-library-when-registering-a-dll/m-p/7176640#M30841</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-06-25T03:22:49Z</dc:date>
    </item>
    <item>
      <title>Re: RegAsm cannot find dependent library when registering a DLL</title>
      <link>https://forums.autodesk.com/t5/net-forum/regasm-cannot-find-dependent-library-when-registering-a-dll/m-p/7179104#M30842</link>
      <description>&lt;P&gt;@Anonymous&amp;nbsp;- you can edit your own post, provided you do it within 30 minutes or someone else hasn't replied.&lt;/P&gt;</description>
      <pubDate>Mon, 26 Jun 2017 14:45:13 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/regasm-cannot-find-dependent-library-when-registering-a-dll/m-p/7179104#M30842</guid>
      <dc:creator>dgorsman</dc:creator>
      <dc:date>2017-06-26T14:45:13Z</dc:date>
    </item>
    <item>
      <title>Re: RegAsm cannot find dependent library when registering a DLL</title>
      <link>https://forums.autodesk.com/t5/net-forum/regasm-cannot-find-dependent-library-when-registering-a-dll/m-p/7180710#M30843</link>
      <description>&lt;P&gt;I don't see any means of editing an existing post.&amp;nbsp; You'd think maybe an 'edit' button, link, or menu item somewhere?&lt;/P&gt;</description>
      <pubDate>Tue, 27 Jun 2017 01:46:38 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/regasm-cannot-find-dependent-library-when-registering-a-dll/m-p/7180710#M30843</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-06-27T01:46:38Z</dc:date>
    </item>
    <item>
      <title>Re: RegAsm cannot find dependent library when registering a DLL</title>
      <link>https://forums.autodesk.com/t5/net-forum/regasm-cannot-find-dependent-library-when-registering-a-dll/m-p/7180943#M30844</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;@Anonymous wrote:&lt;BR /&gt;&lt;P&gt;OK, I guess, unlike StackOverflow, this forum does NOT allow you to edit an existing post so I'll have to reply to myself to correct something in the original post. &amp;nbsp;Seems like an inefficient use of everybody's time... &amp;nbsp;The command line should have been as below - no double '\'s. &amp;nbsp;I just named my new dlls, the namespace, and the classes like they were in the original ACADM 2007 libraries because the VBA IDE doesn't have as nice a facility for renaming variables and types, or reporting errors as VS2012.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;C:\Windows\Microsoft.NET\Framework\v4.0.30319\RegAsm.exe /codebase /tlb:.\GEAuto.tlb .&lt;/SPAN&gt;&lt;SPAN&gt;\GEAuto.dll&lt;/SPAN&gt;&lt;/P&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;The reason you're having the problem is because your assembly is dependent on AcDbMgd.dll, &lt;EM&gt;which cannot be loaded into any process other than AutoCAD&lt;/EM&gt;.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;One way to overcome the problem is to load your assembly into into AutoCAD via the NETLOAD command, and then do the registration via code. &amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You can use the &lt;A href="https://msdn.microsoft.com/en-us/library/system.runtime.interopservices.registrationservices.registerassembly(v=vs.110).aspx" target="_blank"&gt;System.Runtime.InteropServices.RegistrationServices&lt;/A&gt;&amp;nbsp;class to do that.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regarding editing messages, you can do that up to 30 minutes after you've posted, but not afterwards.&lt;/P&gt;</description>
      <pubDate>Tue, 27 Jun 2017 03:46:56 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/regasm-cannot-find-dependent-library-when-registering-a-dll/m-p/7180943#M30844</guid>
      <dc:creator>ActivistInvestor</dc:creator>
      <dc:date>2017-06-27T03:46:56Z</dc:date>
    </item>
    <item>
      <title>Re: RegAsm cannot find dependent library when registering a DLL</title>
      <link>https://forums.autodesk.com/t5/net-forum/regasm-cannot-find-dependent-library-when-registering-a-dll/m-p/7180967#M30845</link>
      <description>&lt;P&gt;That explanation fails to explain why the reference to CompositeCurve2d - which is defined in acdbmgd - does NOT cause any problem like the point and vector are causing.&amp;nbsp; I will try to post a testable code sample later.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;As for editing my own post - I can now see the drop down menu item for this immediately after I make the post.&lt;/P&gt;</description>
      <pubDate>Tue, 27 Jun 2017 04:09:38 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/regasm-cannot-find-dependent-library-when-registering-a-dll/m-p/7180967#M30845</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-06-27T04:09:38Z</dc:date>
    </item>
    <item>
      <title>Re: RegAsm cannot find dependent library when registering a DLL</title>
      <link>https://forums.autodesk.com/t5/net-forum/regasm-cannot-find-dependent-library-when-registering-a-dll/m-p/7186666#M30846</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;@Anonymous wrote:&lt;BR /&gt;&lt;P&gt;That explanation fails to explain why the reference to CompositeCurve2d - which is defined in acdbmgd - does NOT cause any problem like the point and vector are causing.&amp;nbsp; I will try to post a testable code sample later.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;The cause or reason why the code doesn't fail with CompositeCurve2d is&amp;nbsp;irrelevant to the problem.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The problem occurs because acdbmgd.dll cannot be loaded into any process other than AutoCAD. &amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If you really insist on being pedantic, the reason why the failure occurs with Point3d and Vector3d, is because they are structs that perform static, module-level initialization, whereas CompositeCurve2d is not a struct and has no module-level initialization code. It is the static initialization done by Point3d and Vector3d that triggers the loading of acdbmgd.dll. If you had module-level static initialization code (not possible in a pure managed assembly that is not unsafe) that tried to instantiate an instance of CompositeCurve2d or any other class type from acdbmgd.dll, the failure would also occur during loading.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Save yourself the time/effort of posting a test sample, because there is no purpose to it.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 28 Jun 2017 17:54:28 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/regasm-cannot-find-dependent-library-when-registering-a-dll/m-p/7186666#M30846</guid>
      <dc:creator>ActivistInvestor</dc:creator>
      <dc:date>2017-06-28T17:54:28Z</dc:date>
    </item>
    <item>
      <title>Re: RegAsm cannot find dependent library when registering a DLL</title>
      <link>https://forums.autodesk.com/t5/net-forum/regasm-cannot-find-dependent-library-when-registering-a-dll/m-p/7199230#M30847</link>
      <description>&lt;P&gt;That's actually really good information and an important point.&amp;nbsp; I have never worked with the struct in C# - believing them to be the same as in ANSI C and just a grouped set of variable values.&amp;nbsp; Taking new note of how many structs are actually used in the AutoCAD object universe, I am going to pay closer attention to that in the future so I don't make the mistake of working with a value type in the way I would with a reference type. But you're correct, it's not going to help me with the current problem.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Now, for the real problem, I'm no longer sure registration is the root of it.&amp;nbsp; As you say, if the acdbmgd.dll can only be loaded into AutoCAD, and I'm trying to create a COM-visible dll for VBA, my assembly would not get loaded into AutoCAD in the usual 'netload' way.&amp;nbsp; So maybe I'm not even going to be able to do what I thought I'd be able to do?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I actually need to work with both Autodesk.AutoCAD.BoundaryRepresentation as&amp;nbsp; well as Autodesk.AutoCAD.Geometry.&amp;nbsp; I just started with Geometry figuring more people would be familiar with it.&amp;nbsp; I guess I need to post a different question that directly addresses what I'm trying to do.&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>Mon, 03 Jul 2017 05:22:23 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/regasm-cannot-find-dependent-library-when-registering-a-dll/m-p/7199230#M30847</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-07-03T05:22:23Z</dc:date>
    </item>
    <item>
      <title>Re: RegAsm cannot find dependent library when registering a DLL</title>
      <link>https://forums.autodesk.com/t5/net-forum/regasm-cannot-find-dependent-library-when-registering-a-dll/m-p/7199851#M30848</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;@Anonymous wrote:&lt;BR /&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Now, for the real problem, I'm no longer sure registration is the root of it.&amp;nbsp; As you say, if the acdbmgd.dll can only be loaded into AutoCAD, and I'm trying to create a COM-visible dll for VBA, my assembly would not get loaded into AutoCAD in the usual 'netload' way.&amp;nbsp; So maybe I'm not even going to be able to do what I thought I'd be able to do?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;Your assembly must be loaded into AutoCAD's process space. That is done by having the ActiveX client obtain the server using the AcadApplication.GetInterfaceObject() method. This is like GetObject() except that the COM server is loaded into AutoCAD's process rather than the client's process.&lt;/P&gt;</description>
      <pubDate>Mon, 03 Jul 2017 08:08:17 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/regasm-cannot-find-dependent-library-when-registering-a-dll/m-p/7199851#M30848</guid>
      <dc:creator>ActivistInvestor</dc:creator>
      <dc:date>2017-07-03T08:08:17Z</dc:date>
    </item>
    <item>
      <title>Re: RegAsm cannot find dependent library when registering a DLL</title>
      <link>https://forums.autodesk.com/t5/net-forum/regasm-cannot-find-dependent-library-when-registering-a-dll/m-p/7224454#M30849</link>
      <description>&lt;P&gt;So, let me make sure I am clear on the order of events that need to happen:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;1) Develop my .NET dll to replace GeAuto.dll&lt;/P&gt;&lt;P&gt;2) Do a one-time netload of the dll and run a command defined therein to register the assembly for COM (MyLib.GeAuto)&lt;/P&gt;&lt;P&gt;3) Thereafter, I will not need to netload the dll&lt;/P&gt;&lt;P&gt;4) Instead my VBA code will call something like&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;Dim MyGeAuto as MyLib.GeAuto&lt;/P&gt;&lt;P&gt;&amp;nbsp; Set MyGeAuto = AcadApplication.GetInterfaceObject(MyLib.GeAuto)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Does that sound about right?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;gt;&amp;gt;Your assembly must be loaded into AutoCAD's process space. That is done by having the ActiveX client obtain the server using the AcadApplication.GetInterfaceObject() method. This is like GetObject() except that the COM server is loaded into AutoCAD's process rather than the client's process.&lt;/P&gt;</description>
      <pubDate>Thu, 13 Jul 2017 04:11:03 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/regasm-cannot-find-dependent-library-when-registering-a-dll/m-p/7224454#M30849</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-07-13T04:11:03Z</dc:date>
    </item>
    <item>
      <title>Re: RegAsm cannot find dependent library when registering a DLL</title>
      <link>https://forums.autodesk.com/t5/net-forum/regasm-cannot-find-dependent-library-when-registering-a-dll/m-p/7224746#M30850</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;@Anonymous wrote:&lt;BR /&gt;&lt;P&gt;So, let me make sure I am clear on the order of events that need to happen:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;1) Develop my .NET dll to replace GeAuto.dll&lt;/P&gt;&lt;P&gt;2) Do a one-time netload of the dll and run a command defined therein to register the assembly for COM (MyLib.GeAuto)&lt;/P&gt;&lt;P&gt;3) Thereafter, I will not need to netload the dll&lt;/P&gt;&lt;P&gt;4) Instead my VBA code will call something like&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;Dim MyGeAuto as MyLib.GeAuto&lt;/P&gt;&lt;P&gt;&amp;nbsp; Set MyGeAuto = AcadApplication.GetInterfaceObject(MyLib.GeAuto)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Does that sound about right?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Yes, except that you don't need to define a command to register the DLL, you can just do it in the IExtensionApplication.Initialize() method, which is called when the assembly is NETLOADed.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 13 Jul 2017 06:24:09 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/regasm-cannot-find-dependent-library-when-registering-a-dll/m-p/7224746#M30850</guid>
      <dc:creator>ActivistInvestor</dc:creator>
      <dc:date>2017-07-13T06:24:09Z</dc:date>
    </item>
    <item>
      <title>Re: RegAsm cannot find dependent library when registering a DLL</title>
      <link>https://forums.autodesk.com/t5/net-forum/regasm-cannot-find-dependent-library-when-registering-a-dll/m-p/7231604#M30851</link>
      <description>&lt;P&gt;The problem with using the Initialize method is that the registration requires elevated permissions.&amp;nbsp; So, in order for it to succeed, AutoCAD needs&amp;nbsp;the Run as administrator treatment on launch.&amp;nbsp; Better to use a separate registration method so AutoCAD can be run as administrator, the command to register the&amp;nbsp;dll executed, and thereafter it can be run normally and the library used from VBA without firing the Initialize method upon GetInterfaceObject.&lt;/P&gt;</description>
      <pubDate>Mon, 17 Jul 2017 03:31:00 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/regasm-cannot-find-dependent-library-when-registering-a-dll/m-p/7231604#M30851</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-07-17T03:31:00Z</dc:date>
    </item>
    <item>
      <title>Re: RegAsm cannot find dependent library when registering a DLL</title>
      <link>https://forums.autodesk.com/t5/net-forum/regasm-cannot-find-dependent-library-when-registering-a-dll/m-p/7232937#M30852</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;@Anonymous wrote:&lt;BR /&gt;&lt;P&gt;The problem with using the Initialize method is that the registration requires elevated permissions.&amp;nbsp; So, in order for it to succeed, AutoCAD needs&amp;nbsp;the Run as administrator treatment on launch.&amp;nbsp; Better to use a separate registration method so AutoCAD can be run as administrator, the command to register the&amp;nbsp;dll executed, and thereafter it can be run normally and the library used from VBA without firing the Initialize method upon GetInterfaceObject.&lt;/P&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;The idea was to use NETLOAD to register the assembly, not GetInterfaceObject(). &amp;nbsp;If the IExtensionApplication.Initialize() method is running when you call GetInterfaceObject(), you can look at the active command in the editor, and see if it is NETLOAD, and do the registration only in that case.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;That way, you don't need to use a command, you just have to NETLOAD the assembly to register it. If you want to provide a means of un-registering the assembly, then you will need a command for that.&lt;/P&gt;</description>
      <pubDate>Mon, 17 Jul 2017 15:28:44 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/regasm-cannot-find-dependent-library-when-registering-a-dll/m-p/7232937#M30852</guid>
      <dc:creator>ActivistInvestor</dc:creator>
      <dc:date>2017-07-17T15:28:44Z</dc:date>
    </item>
  </channel>
</rss>

