<?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: Netload and plugin installation in .NET Forum</title>
    <link>https://forums.autodesk.com/t5/net-forum/netload-and-plugin-installation/m-p/13341415#M722</link>
    <description>&lt;P&gt;NETLOAD command not displaying anything could be anything, good or bad. If it is AutoCAD security issue (i.e. loaded from a location that is not trusted folder), AutoCAD should prompts its security warning PRIOR to the dll is loaded. If your user obtained your DLL via the Internet (downlaoded from somewhere, or you emailed to them), then Windows will automatically flag the downloaded the DLL (or any executable file, for that matter) as unsafe. If loaded into AutoCAD, AutoCAD will generate error message of failed loading. So the DLL obtained via the Internet needs to be unlocked before use.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Since you get nothing displayed after NETLOAD command, it is likely your code error, if your DLL implemented IExtensionApplication and does something bad in Initialize() implementation. Since you did not provide any details about your code and/or how users get it "installed", I stop guessing here.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 26 Feb 2025 16:50:56 GMT</pubDate>
    <dc:creator>norman.yuan</dc:creator>
    <dc:date>2025-02-26T16:50:56Z</dc:date>
    <item>
      <title>Netload and plugin installation</title>
      <link>https://forums.autodesk.com/t5/net-forum/netload-and-plugin-installation/m-p/13340747#M720</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I built a .NET dll for Autocad that loads and works fine on my machine, using the Netload command. But when I install my plugin on another machine, it won't work: its commands are not registered, they are unknown in Autocad. Netload does not display any error, as a matter of fact, it displays nothing. As far as I know, the issue seems to be related to Windows security stuff. What do you think?&lt;/P&gt;</description>
      <pubDate>Wed, 26 Feb 2025 12:30:26 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/netload-and-plugin-installation/m-p/13340747#M720</guid>
      <dc:creator>jptallano</dc:creator>
      <dc:date>2025-02-26T12:30:26Z</dc:date>
    </item>
    <item>
      <title>Re: Netload and plugin installation</title>
      <link>https://forums.autodesk.com/t5/net-forum/netload-and-plugin-installation/m-p/13341397#M721</link>
      <description>&lt;P&gt;No commands, and no error usually result from an exception that occurs when your assembly is loaded. That could happen if your assembly is dependent on other assemblies that are not loadable on the target system, it could be an exception in your assembly in code that runs at startup. Does your assembly have an IExtensionApplication. If it does, you can put the code in the Initialize() method inside of try{} block, followed by a catch{} block that catches and displays any exceptions that are raised.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 26 Feb 2025 16:43:28 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/netload-and-plugin-installation/m-p/13341397#M721</guid>
      <dc:creator>ActivistInvestor</dc:creator>
      <dc:date>2025-02-26T16:43:28Z</dc:date>
    </item>
    <item>
      <title>Re: Netload and plugin installation</title>
      <link>https://forums.autodesk.com/t5/net-forum/netload-and-plugin-installation/m-p/13341415#M722</link>
      <description>&lt;P&gt;NETLOAD command not displaying anything could be anything, good or bad. If it is AutoCAD security issue (i.e. loaded from a location that is not trusted folder), AutoCAD should prompts its security warning PRIOR to the dll is loaded. If your user obtained your DLL via the Internet (downlaoded from somewhere, or you emailed to them), then Windows will automatically flag the downloaded the DLL (or any executable file, for that matter) as unsafe. If loaded into AutoCAD, AutoCAD will generate error message of failed loading. So the DLL obtained via the Internet needs to be unlocked before use.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Since you get nothing displayed after NETLOAD command, it is likely your code error, if your DLL implemented IExtensionApplication and does something bad in Initialize() implementation. Since you did not provide any details about your code and/or how users get it "installed", I stop guessing here.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 26 Feb 2025 16:50:56 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/netload-and-plugin-installation/m-p/13341415#M722</guid>
      <dc:creator>norman.yuan</dc:creator>
      <dc:date>2025-02-26T16:50:56Z</dc:date>
    </item>
    <item>
      <title>Re: Netload and plugin installation</title>
      <link>https://forums.autodesk.com/t5/net-forum/netload-and-plugin-installation/m-p/13341508#M723</link>
      <description>&lt;P&gt;Hi guys, and thanks for you answers.&lt;/P&gt;&lt;P&gt;So far, installation on another machine is done by retrieving the dll from a local network drive. I already tried moving it to a trusted Autocad location.&lt;/P&gt;&lt;P&gt;App indeed extends IExtensionApplication, and Initialize() code already implements try/catch:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;using application = Autodesk.AutoCAD.ApplicationServices.Application;
public void Initialize()
{
    try
    {
        application.DocumentManager.MdiActiveDocument.Editor.WriteMessage("\nInitializing...");
        // Init stuff
        application.DocumentManager.MdiActiveDocument.Editor.WriteMessage("\nInitializing completed.");
    }
    catch (System.Exception e)
    {
        application.DocumentManager.MdiActiveDocument.Editor.WriteMessage("\Error while initializing app: " + e.Message);
    }
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regarding Windows marking the dll as unsafe, I don't know how to unlock it. Its file properties dialog won't display the "unlock" checkbox.&lt;/P&gt;&lt;P&gt;PS: When compililng the dll on the target machine, it successfully loads and works in Autocad.&lt;/P&gt;</description>
      <pubDate>Wed, 26 Feb 2025 17:45:29 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/netload-and-plugin-installation/m-p/13341508#M723</guid>
      <dc:creator>jptallano</dc:creator>
      <dc:date>2025-02-26T17:45:29Z</dc:date>
    </item>
    <item>
      <title>Re: Netload and plugin installation</title>
      <link>https://forums.autodesk.com/t5/net-forum/netload-and-plugin-installation/m-p/13341714#M724</link>
      <description>&lt;P&gt;I have seen this when required DLLs, like in my case NLog.dll, were not copied to the target computer.&lt;/P&gt;</description>
      <pubDate>Wed, 26 Feb 2025 19:53:19 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/netload-and-plugin-installation/m-p/13341714#M724</guid>
      <dc:creator>Kari.Heinola</dc:creator>
      <dc:date>2025-02-26T19:53:19Z</dc:date>
    </item>
    <item>
      <title>Re: Netload and plugin installation</title>
      <link>https://forums.autodesk.com/t5/net-forum/netload-and-plugin-installation/m-p/13341926#M725</link>
      <description>&lt;P&gt;You may not be seeing any error message written to the command line if a document is not active. Try putting the error trap in the OnIdle event, like below.&lt;/P&gt;
&lt;LI-CODE lang="csharp"&gt;
using Autodesk.AutoCAD.ApplicationServices;
using AcAp = Autodesk.AutoCAD.ApplicationServices.Application;
using Autodesk.AutoCAD.DatabaseServices;
using Autodesk.AutoCAD.EditorInput;
using Autodesk.AutoCAD.Geometry;
using Autodesk.AutoCAD.Runtime;
using System;

// This line is not mandatory, but improves loading performances
[assembly: ExtensionApplication(typeof(EJ_.MyPlugin))]

namespace EJ_
{
    public class MyPlugin : IExtensionApplication
    {

        void IExtensionApplication.Initialize()
        {
            AcAp.Idle += OnIdle;
        }

        void IExtensionApplication.Terminate()
        {
            // Do plug-in application clean up here
        }
        private void OnIdle(object sender, EventArgs e)
        {
            var doc = AcAp.DocumentManager.MdiActiveDocument;
            if (doc != null)
            {
                Application.Idle -= OnIdle;
                try
                {
                    doc.Editor.WriteMessage("\nEJ_PageSetupImport loaded.\n");
                }
                catch (System.Exception ex)
                {
                    doc.Editor.WriteMessage($"\nInitilization error: {ex.Message}");
                    doc.Editor.WriteMessage($"\nStack Trace: {ex.StackTrace}");
                }                
            }
        }
    }
}
&lt;/LI-CODE&gt;</description>
      <pubDate>Wed, 26 Feb 2025 22:20:14 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/netload-and-plugin-installation/m-p/13341926#M725</guid>
      <dc:creator>Ed__Jobe</dc:creator>
      <dc:date>2025-02-26T22:20:14Z</dc:date>
    </item>
    <item>
      <title>Re: Netload and plugin installation</title>
      <link>https://forums.autodesk.com/t5/net-forum/netload-and-plugin-installation/m-p/13342069#M726</link>
      <description>&lt;P&gt;Don't waste time adding Idle event handlers, because you can't use the NETLOAD command without an active document.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The exception can occur long before your Initialize() method runs, if it references a type from an assembly that can't be loaded. In that case, Initialize() will never be called, because the exception occurs when it is just-in-time compiled prior to calling it. It's that JIT process where types that are referenced from Initialize() are loaded, from whatever assemblies they're in, and if the correct version of one of those assemblies cannot be found/loaded, that's when the exception occurs.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Add a line to display a message on the console in the Initialize() method to confirm it's being called.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If Initialize() not being called, the easiest way to diagnose this, is to add a handler to the AppDomain's FirstChanceException event in another assembly that's already loaded. In the handler for the FirstChanceException event, dump the exception stacktrace to the console. That must be done in another assembly that's already loaded when you try to load the problematic assembly.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Another way to identify issues with assembly binding failures is to use fuslogvw.exe:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Fusion Log Viewer&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-unicode-emoji" title=":small_blue_diamond:"&gt;🔹&lt;/span&gt;&lt;STRONG&gt;Location:&lt;/STRONG&gt; C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX &amp;lt;version&amp;gt;\fuslogvw.exe&lt;BR /&gt;&lt;span class="lia-unicode-emoji" title=":small_blue_diamond:"&gt;🔹&lt;/span&gt;&lt;STRONG&gt;How to use:&lt;/STRONG&gt;&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;Open a Command Prompt as Administrator.&lt;/LI&gt;&lt;LI&gt;Run fuslogvw.exe.&lt;/LI&gt;&lt;LI&gt;In the &lt;STRONG&gt;Fusion Log Viewer&lt;/STRONG&gt;, enable logging (Settings → Log All Binds).&lt;/LI&gt;&lt;LI&gt;Load your assembly (e.g., via NETLOAD in AutoCAD).&lt;/LI&gt;&lt;LI&gt;Refresh fuslogvw.exe to see binding failures.&lt;/LI&gt;&lt;LI&gt;Click on an entry to see details about why the assembly failed to load.&lt;/LI&gt;&lt;/OL&gt;</description>
      <pubDate>Thu, 27 Feb 2025 01:36:30 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/netload-and-plugin-installation/m-p/13342069#M726</guid>
      <dc:creator>ActivistInvestor</dc:creator>
      <dc:date>2025-02-27T01:36:30Z</dc:date>
    </item>
    <item>
      <title>Re: Netload and plugin installation</title>
      <link>https://forums.autodesk.com/t5/net-forum/netload-and-plugin-installation/m-p/13354184#M727</link>
      <description>&lt;P&gt;Sorry for the delay, I could not answer sooner.&lt;/P&gt;&lt;P&gt;Using ActivistInvestor suggestion with FirstChanceException, I could solve the problem, and it was all my fault, because of a stupid assumption I was making.&lt;/P&gt;&lt;P&gt;Actually, the problem was that Autocad's version on the system I was installing my plugin on was newer than Autocad's version on my development computer. I&amp;nbsp;mistakenly thought retro-compatibility was ensured - given that the gap between versions was not too far.&lt;/P&gt;&lt;P&gt;But that leads to another question: Do I need to have as many source project versions (carrying the same code but with different&amp;nbsp;AcCoreMgd.dll/AcDbMgd.dll references) as there are Autocad versions I want to support?&lt;/P&gt;</description>
      <pubDate>Wed, 05 Mar 2025 16:07:26 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/netload-and-plugin-installation/m-p/13354184#M727</guid>
      <dc:creator>jptallano</dc:creator>
      <dc:date>2025-03-05T16:07:26Z</dc:date>
    </item>
    <item>
      <title>Re: Netload and plugin installation</title>
      <link>https://forums.autodesk.com/t5/net-forum/netload-and-plugin-installation/m-p/13354404#M728</link>
      <description>&lt;P&gt;You can compile your app to Target a given version of the net framework. And it should run on any version of AutoCAD that uses that same version of the framework. For example, for AutoCAD 2025 you would need to create a separate assembly then the one that you would need to load for AutoCAD 2024 because they use different versions of The NET Framework&lt;/P&gt;</description>
      <pubDate>Wed, 05 Mar 2025 17:42:20 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/netload-and-plugin-installation/m-p/13354404#M728</guid>
      <dc:creator>ActivistInvestor</dc:creator>
      <dc:date>2025-03-05T17:42:20Z</dc:date>
    </item>
  </channel>
</rss>

