<?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: Can not load dll to audocad in .NET Forum</title>
    <link>https://forums.autodesk.com/t5/net-forum/can-not-load-dll-to-audocad/m-p/12567755#M5416</link>
    <description>&lt;P&gt;Thank you for your message!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried your approach, but still the same problem. I even commented out everything in my Initialize method, but still nothing happened...&lt;/P&gt;</description>
    <pubDate>Sun, 18 Feb 2024 16:37:04 GMT</pubDate>
    <dc:creator>tothapal</dc:creator>
    <dc:date>2024-02-18T16:37:04Z</dc:date>
    <item>
      <title>Can not load dll to audocad</title>
      <link>https://forums.autodesk.com/t5/net-forum/can-not-load-dll-to-audocad/m-p/12567506#M5414</link>
      <description>&lt;P&gt;I have a dll with multiple commands and we are using it with Civil 3d 2021 perfectly in the last few years. I developed a new command which isn't using any civil objects (only autocad objects) and it is working perfectly in civil. However, if I try to load my dll to autocad 2021 nothing happens, no error message and the commands are not there. I tried to run it in debug mod and added a breakpoint in the first row in the initialize method, but never stops.&amp;nbsp; &amp;nbsp;&lt;/P&gt;&lt;P&gt;I have created a new dll to try, added the same resources, same nugets, changed the settings to be the same (same .net framework...) and even added civil objects to the code and it is working properly in autocad, but my orignial dll not.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is there a way to solve this problem? If I would get an error message, the would be already a help...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 18 Feb 2024 11:42:23 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/can-not-load-dll-to-audocad/m-p/12567506#M5414</guid>
      <dc:creator>tothapal</dc:creator>
      <dc:date>2024-02-18T11:42:23Z</dc:date>
    </item>
    <item>
      <title>Re: Can not load dll to audocad</title>
      <link>https://forums.autodesk.com/t5/net-forum/can-not-load-dll-to-audocad/m-p/12567721#M5415</link>
      <description>&lt;P&gt;AutoCAD suppresses exceptions that are thrown from the IExtensionApplication.Initialize() method. Most-likely the cause is something in your initialization code that may be referencing a type from the Civil3d assemblies.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The following code shows how I avoid the problem of AutoCAD suppressing or concealing exceptions in an IExtensionApplication's Initialize() method:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="general"&gt;/// &amp;lt;summary&amp;gt;
/// Abstract base type for ExtensionApplications, that defers
/// Initialization until the first idle event when there is an
/// open document.
///
/// This class will also report exceptions thrown by an
/// override of the Intialize() method on the command line,
/// which solves the problem of AutoCAD's managed runtime
/// suppressing or concealing exceptions thrown from the
/// IExtensionApplication.Initlialize() method.
///
/// Usage:
///
/// This class should not be altered. Just include it in 
/// a project and derive a new class from this class, and 
/// implement/override the Initialize() method to do one-time 
/// initialization at startup, and optionally, override the 
/// Terminate() method to do finalization tasks at shutdown.
/// 
/// &amp;lt;/summary&amp;gt;

public abstract class ExtensionApplicationAsync : IExtensionApplication
{
   void IExtensionApplication.Initialize()
   {
      this.Initialize();
   }

   protected abstract void Initialize();
   protected virtual void Terminate()
   {
   }

   void OnIdle(object sender, EventArgs e)
   {
      if(Application.DocumentManager.MdiActiveDocument != null)
      {
         Application.Idle -= OnIdle;
         try
         {
            this.Initialize();
         }
         catch(System.Exception ex)
         {
            Application.DocumentManager.MdiActiveDocument.Editor.WriteMessage(
               ex.ToString());
         }
      }
   }

   void IExtensionApplication.Terminate()
   {
      this.Terminate();
   }
}

/// &amp;lt;summary&amp;gt;
/// Example use of ExtensionApplicationAsync.
/// None of the code above needs to be altered.
/// Instead, you just derive your class from it.
/// &amp;lt;/summary&amp;gt;

public class MyApplication : ExtensionApplicationAsync
{
   protected override void Initialize()
   {
      /// TODO: Initialize your application here
   }

   protected override void Terminate()
   {
       /// TODO: Finalize your application here
   }
}&lt;/LI-CODE&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;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 18 Feb 2024 16:23:48 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/can-not-load-dll-to-audocad/m-p/12567721#M5415</guid>
      <dc:creator>ActivistInvestor</dc:creator>
      <dc:date>2024-02-18T16:23:48Z</dc:date>
    </item>
    <item>
      <title>Re: Can not load dll to audocad</title>
      <link>https://forums.autodesk.com/t5/net-forum/can-not-load-dll-to-audocad/m-p/12567755#M5416</link>
      <description>&lt;P&gt;Thank you for your message!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried your approach, but still the same problem. I even commented out everything in my Initialize method, but still nothing happened...&lt;/P&gt;</description>
      <pubDate>Sun, 18 Feb 2024 16:37:04 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/can-not-load-dll-to-audocad/m-p/12567755#M5416</guid>
      <dc:creator>tothapal</dc:creator>
      <dc:date>2024-02-18T16:37:04Z</dc:date>
    </item>
    <item>
      <title>Re: Can not load dll to audocad</title>
      <link>https://forums.autodesk.com/t5/net-forum/can-not-load-dll-to-audocad/m-p/12567849#M5417</link>
      <description>&lt;P&gt;That means the problem is not in your Initialize() method, it is happening before AutoCAD calls the Initialize() method. That's usually an indication that it can't load a dependent assembly. So, you'll have to try to identify what dependent assembly is causing the problem and remove the dependency.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You might want to &lt;A href="https://techcommunity.microsoft.com/t5/iis-support-blog/fusion-log-viewer-fuslogvw-exe/ba-p/784396" target="_blank" rel="noopener"&gt;enable fusion logging&lt;/A&gt; to find out more about what's happening.&lt;/P&gt;</description>
      <pubDate>Sun, 18 Feb 2024 18:10:58 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/can-not-load-dll-to-audocad/m-p/12567849#M5417</guid>
      <dc:creator>ActivistInvestor</dc:creator>
      <dc:date>2024-02-18T18:10:58Z</dc:date>
    </item>
    <item>
      <title>Re: Can not load dll to audocad</title>
      <link>https://forums.autodesk.com/t5/net-forum/can-not-load-dll-to-audocad/m-p/12568783#M5418</link>
      <description>&lt;P&gt;Thank you again your reply. I tried to use the Fusion log viewer, but I didn't get any log message while I loaded the dll.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 19 Feb 2024 10:03:27 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/can-not-load-dll-to-audocad/m-p/12568783#M5418</guid>
      <dc:creator>tothapal</dc:creator>
      <dc:date>2024-02-19T10:03:27Z</dc:date>
    </item>
  </channel>
</rss>

