<?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 Exception thrown could not load assembly in AutoCAD 2025 .NET 8 in .NET Forum</title>
    <link>https://forums.autodesk.com/t5/net-forum/exception-thrown-could-not-load-assembly-in-autocad-2025-net-8/m-p/13131968#M2058</link>
    <description>&lt;P&gt;I've added &lt;A href="https://docs.closedxml.io/en/latest/index.html" target="_blank" rel="noopener"&gt;ClosedXML&lt;/A&gt; to my plugin for AutoCAD 2025 using .NET 8.0. I can still compile and run my plugin. But when I launch a command that uses a method from a class that requires ClosedXML, I get an exception while debugging&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;LI-CODE lang="general"&gt;System.IO.FileLoadException
  HResult=0x80131621
  Message=Could not load file or assembly 'ClosedXML, Version=0.104.1.0, Culture=neutral, PublicKeyToken=null'. Could not find or load a specific file. (0x80131621)&lt;/LI-CODE&gt;&lt;P&gt;&lt;BR /&gt;I've already verified that my .dll and the .dll of ClosedXML and it's dependencies are all present in the same folder.&lt;BR /&gt;&lt;BR /&gt;I'm wondering if its a problem that ClosedXML is targeting .NET Standard?&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;I've also tried to do Assembly.LoadFrom("ClosedXML.dll") in the command before calling the method that requires ClosedXML, but had the same exception occur.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Here is the command and the code it's calling&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;[CommandMethod("MyTools", nameof(Test), CommandFlags.Modal | CommandFlags.UsePickSet)]
public void Test()
{
    Editor ed = _doc.Editor;
    Database db = _doc.Database;
    
    using Transaction tr = _doc.Database.TransactionManager.StartTransaction();  

    
    CSVExporter.Export(new Project.Project(_doc, tr));

    tr.Commit();

    
}&lt;/LI-CODE&gt;&lt;LI-CODE lang="csharp"&gt;public class Project(Document doc, Transaction tr)
{
    public Document Document { get; } = doc;
    public Transaction Transaction { get; } = tr;
}&lt;/LI-CODE&gt;&lt;LI-CODE lang="csharp"&gt;public class CSVExporter
{
    public static void Export(Project.Project project)
    {
        if (!project.Document.CreateDirectory("data", out var path))
        {
            project.Document.Editor.WriteMessage($"\nProblem finding or creating data folder.");
            return;
        }
        
        string fullFileName = Path.GetFileName(project.Document.Name);
        string fileName = Regex.Replace(fullFileName, @".dwg$", ".xlsx", RegexOptions.IgnoreCase);

        string newPath = Path.Combine(path, fileName);

        using var workbook = new XLWorkbook();
        var mainWorksheet = workbook.AddWorksheet("WCS");




        workbook.SaveAs(newPath);
    }
}&lt;/LI-CODE&gt;&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 05 Nov 2024 19:11:48 GMT</pubDate>
    <dc:creator>nshupeFMPE3</dc:creator>
    <dc:date>2024-11-05T19:11:48Z</dc:date>
    <item>
      <title>Exception thrown could not load assembly in AutoCAD 2025 .NET 8</title>
      <link>https://forums.autodesk.com/t5/net-forum/exception-thrown-could-not-load-assembly-in-autocad-2025-net-8/m-p/13131968#M2058</link>
      <description>&lt;P&gt;I've added &lt;A href="https://docs.closedxml.io/en/latest/index.html" target="_blank" rel="noopener"&gt;ClosedXML&lt;/A&gt; to my plugin for AutoCAD 2025 using .NET 8.0. I can still compile and run my plugin. But when I launch a command that uses a method from a class that requires ClosedXML, I get an exception while debugging&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;LI-CODE lang="general"&gt;System.IO.FileLoadException
  HResult=0x80131621
  Message=Could not load file or assembly 'ClosedXML, Version=0.104.1.0, Culture=neutral, PublicKeyToken=null'. Could not find or load a specific file. (0x80131621)&lt;/LI-CODE&gt;&lt;P&gt;&lt;BR /&gt;I've already verified that my .dll and the .dll of ClosedXML and it's dependencies are all present in the same folder.&lt;BR /&gt;&lt;BR /&gt;I'm wondering if its a problem that ClosedXML is targeting .NET Standard?&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;I've also tried to do Assembly.LoadFrom("ClosedXML.dll") in the command before calling the method that requires ClosedXML, but had the same exception occur.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Here is the command and the code it's calling&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;[CommandMethod("MyTools", nameof(Test), CommandFlags.Modal | CommandFlags.UsePickSet)]
public void Test()
{
    Editor ed = _doc.Editor;
    Database db = _doc.Database;
    
    using Transaction tr = _doc.Database.TransactionManager.StartTransaction();  

    
    CSVExporter.Export(new Project.Project(_doc, tr));

    tr.Commit();

    
}&lt;/LI-CODE&gt;&lt;LI-CODE lang="csharp"&gt;public class Project(Document doc, Transaction tr)
{
    public Document Document { get; } = doc;
    public Transaction Transaction { get; } = tr;
}&lt;/LI-CODE&gt;&lt;LI-CODE lang="csharp"&gt;public class CSVExporter
{
    public static void Export(Project.Project project)
    {
        if (!project.Document.CreateDirectory("data", out var path))
        {
            project.Document.Editor.WriteMessage($"\nProblem finding or creating data folder.");
            return;
        }
        
        string fullFileName = Path.GetFileName(project.Document.Name);
        string fileName = Regex.Replace(fullFileName, @".dwg$", ".xlsx", RegexOptions.IgnoreCase);

        string newPath = Path.Combine(path, fileName);

        using var workbook = new XLWorkbook();
        var mainWorksheet = workbook.AddWorksheet("WCS");




        workbook.SaveAs(newPath);
    }
}&lt;/LI-CODE&gt;&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 05 Nov 2024 19:11:48 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/exception-thrown-could-not-load-assembly-in-autocad-2025-net-8/m-p/13131968#M2058</guid>
      <dc:creator>nshupeFMPE3</dc:creator>
      <dc:date>2024-11-05T19:11:48Z</dc:date>
    </item>
    <item>
      <title>Re: Exception thrown could not load assembly in AutoCAD 2025 .NET 8</title>
      <link>https://forums.autodesk.com/t5/net-forum/exception-thrown-could-not-load-assembly-in-autocad-2025-net-8/m-p/13132163#M2059</link>
      <description>&lt;P&gt;You should verify that the assembly is targeting.net 8.0 because otherwise you will get this error when the runtime tries to load it.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 05 Nov 2024 20:48:10 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/exception-thrown-could-not-load-assembly-in-autocad-2025-net-8/m-p/13132163#M2059</guid>
      <dc:creator>ActivistInvestor</dc:creator>
      <dc:date>2024-11-05T20:48:10Z</dc:date>
    </item>
    <item>
      <title>Re: Exception thrown could not load assembly in AutoCAD 2025 .NET 8</title>
      <link>https://forums.autodesk.com/t5/net-forum/exception-thrown-could-not-load-assembly-in-autocad-2025-net-8/m-p/13132170#M2060</link>
      <description>My assembly is indeed targeting .NET 8, but from what I see on the Nuget description for ClosedXML it can target either .NET Standard 2.0 or 2.1.&lt;BR /&gt;&lt;BR /&gt;It was my understanding that a .NET 8 environment could run a .NET Standard assembly, but I guess I'm partially mistaken?</description>
      <pubDate>Tue, 05 Nov 2024 20:51:39 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/exception-thrown-could-not-load-assembly-in-autocad-2025-net-8/m-p/13132170#M2060</guid>
      <dc:creator>nshupeFMPE3</dc:creator>
      <dc:date>2024-11-05T20:51:39Z</dc:date>
    </item>
    <item>
      <title>Re: Exception thrown could not load assembly in AutoCAD 2025 .NET 8</title>
      <link>https://forums.autodesk.com/t5/net-forum/exception-thrown-could-not-load-assembly-in-autocad-2025-net-8/m-p/13132186#M2061</link>
      <description>&lt;P&gt;I was referring to the ClosedXML Assembly, not your assembly. You will probably need to check out the repository and build a net 8.0 version of it.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 05 Nov 2024 20:59:07 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/exception-thrown-could-not-load-assembly-in-autocad-2025-net-8/m-p/13132186#M2061</guid>
      <dc:creator>ActivistInvestor</dc:creator>
      <dc:date>2024-11-05T20:59:07Z</dc:date>
    </item>
    <item>
      <title>Re: Exception thrown could not load assembly in AutoCAD 2025 .NET 8</title>
      <link>https://forums.autodesk.com/t5/net-forum/exception-thrown-could-not-load-assembly-in-autocad-2025-net-8/m-p/13132193#M2062</link>
      <description>&lt;P&gt;If it uses System.Data.SqlClient, check to see what version of that it is using. I'm pretty sure AutoCAD uses that assembly and if it does, then you must use the same version AutoCAD uses.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 05 Nov 2024 21:02:37 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/exception-thrown-could-not-load-assembly-in-autocad-2025-net-8/m-p/13132193#M2062</guid>
      <dc:creator>ActivistInvestor</dc:creator>
      <dc:date>2024-11-05T21:02:37Z</dc:date>
    </item>
    <item>
      <title>Re: Exception thrown could not load assembly in AutoCAD 2025 .NET 8</title>
      <link>https://forums.autodesk.com/t5/net-forum/exception-thrown-could-not-load-assembly-in-autocad-2025-net-8/m-p/13132201#M2063</link>
      <description>&lt;P&gt;Thank you for the help, these are both good idea's I will try. By chance how would you determine the version of something like System.Data.SqlClient that AutoCAD uses? Though I will not that in this particular case I dont see that as a dependency for ClosedXML.&lt;/P&gt;</description>
      <pubDate>Tue, 05 Nov 2024 21:08:34 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/exception-thrown-could-not-load-assembly-in-autocad-2025-net-8/m-p/13132201#M2063</guid>
      <dc:creator>nshupeFMPE3</dc:creator>
      <dc:date>2024-11-05T21:08:34Z</dc:date>
    </item>
    <item>
      <title>Re: Exception thrown could not load assembly in AutoCAD 2025 .NET 8</title>
      <link>https://forums.autodesk.com/t5/net-forum/exception-thrown-could-not-load-assembly-in-autocad-2025-net-8/m-p/13132357#M2064</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/11150561"&gt;@nshupeFMPE3&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;&lt;P&gt;Thank you for the help, these are both good idea's I will try. By chance how would you determine the version of something like System.Data.SqlClient that AutoCAD uses? Though I will not that in this particular case I dont see that as a dependency for ClosedXML.&lt;/P&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;You can use &lt;A href="https://learn.microsoft.com/en-us/sysinternals/downloads/process-explorer" target="_blank" rel="noopener"&gt;Process Explorer&lt;/A&gt;&amp;nbsp;or you can run this PowerShell command (as an admin):&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="general"&gt;Get-Process -Name acad | ForEach-Object { $_.Modules }&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My advice would be to check-out the entire ClosedXML repository, open the project and upgrade it to .NET 8.0, since that's really the only way to identify one of possibly-many versioning issues.&lt;/P&gt;</description>
      <pubDate>Tue, 05 Nov 2024 23:00:03 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/exception-thrown-could-not-load-assembly-in-autocad-2025-net-8/m-p/13132357#M2064</guid>
      <dc:creator>ActivistInvestor</dc:creator>
      <dc:date>2024-11-05T23:00:03Z</dc:date>
    </item>
    <item>
      <title>Re: Exception thrown could not load assembly in AutoCAD 2025 .NET 8</title>
      <link>https://forums.autodesk.com/t5/net-forum/exception-thrown-could-not-load-assembly-in-autocad-2025-net-8/m-p/13134027#M2065</link>
      <description>&lt;P&gt;EDIT: Nevermind, stopped working again. Thats really weird...&lt;BR /&gt;&lt;BR /&gt;Well I'm not sure why things started working, which is always kind of a weird feeling.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;I set the Environment variable CoreHost_Trace and CoreHost_TraceFile in the launch settings for debugging from Visual Studio and once I did that it started working? Even after I've removed the Environment Variables/ reset them its still working.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Not sure if I should mark this as a solution (haha), but maybe restarting my Visual Studio or turning the computer off and on again would have worked just as well.&lt;/P&gt;</description>
      <pubDate>Wed, 06 Nov 2024 16:05:28 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/exception-thrown-could-not-load-assembly-in-autocad-2025-net-8/m-p/13134027#M2065</guid>
      <dc:creator>nshupeFMPE3</dc:creator>
      <dc:date>2024-11-06T16:05:28Z</dc:date>
    </item>
    <item>
      <title>Re: Exception thrown could not load assembly in AutoCAD 2025 .NET 8</title>
      <link>https://forums.autodesk.com/t5/net-forum/exception-thrown-could-not-load-assembly-in-autocad-2025-net-8/m-p/13143848#M2066</link>
      <description>&lt;P&gt;FWIW&lt;/P&gt;&lt;P&gt;I just finished an update to .NET 8 that creates an XLSX workbook but it uses the DocumentFormat.OpenXml library.&lt;/P&gt;&lt;P&gt;I have used this library for a few years now.&amp;nbsp; It is provided with an acad 25 install&lt;/P&gt;&lt;P&gt;C:\Program Files\Autodesk\AutoCAD 2025\DocumentFormat.OpenXml.dll.&lt;/P&gt;&lt;P&gt;Copy local needs to be "Yes".&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 11 Nov 2024 17:13:33 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/exception-thrown-could-not-load-assembly-in-autocad-2025-net-8/m-p/13143848#M2066</guid>
      <dc:creator>fieldguy</dc:creator>
      <dc:date>2024-11-11T17:13:33Z</dc:date>
    </item>
    <item>
      <title>Re: Exception thrown could not load assembly in AutoCAD 2025 .NET 8</title>
      <link>https://forums.autodesk.com/t5/net-forum/exception-thrown-could-not-load-assembly-in-autocad-2025-net-8/m-p/13143861#M2067</link>
      <description>Thank you for the suggestion &lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/81963"&gt;@fieldguy&lt;/a&gt;. My plugin previous to 2025 used OpenXml and it does get the job done. But it's kind of clunky and annoying to use IMO. I'm at the point were ClosedXML is working for my plugin, just not when debugging mode is running, which is annoying but not the end of the world.</description>
      <pubDate>Mon, 11 Nov 2024 17:20:12 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/exception-thrown-could-not-load-assembly-in-autocad-2025-net-8/m-p/13143861#M2067</guid>
      <dc:creator>nshupeFMPE3</dc:creator>
      <dc:date>2024-11-11T17:20:12Z</dc:date>
    </item>
    <item>
      <title>Re: Exception thrown could not load assembly in AutoCAD 2025 .NET 8</title>
      <link>https://forums.autodesk.com/t5/net-forum/exception-thrown-could-not-load-assembly-in-autocad-2025-net-8/m-p/13743370#M85543</link>
      <description>&lt;P&gt;The issue is that AutoCAD 2025 and 2026 are using ClosedXML v0.100.3.0 and v0.102.2 respectively.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Use the&amp;nbsp;ClosedXML NuGet&amp;nbsp;that matches the version AutoCAD is using and you will be able to debug.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Because AutoCAD is loading ClosedXML from the&amp;nbsp;AutoCAD executing location, your plugin is going to use the version of ClosedXML AutoCAD is loading regardless of which NuGet&amp;nbsp;package you have. Depending on what your plugin does, that may not matter. Where it could matter is that ClosedXML v0.100.0 through 0.102.3 have an issue that throws exceptions when trying to parse excel formulas.&lt;/P&gt;</description>
      <pubDate>Mon, 28 Jul 2025 19:16:07 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/exception-thrown-could-not-load-assembly-in-autocad-2025-net-8/m-p/13743370#M85543</guid>
      <dc:creator>dpaytonBZ25K</dc:creator>
      <dc:date>2025-07-28T19:16:07Z</dc:date>
    </item>
    <item>
      <title>Re: Exception thrown could not load assembly in AutoCAD 2025 .NET 8</title>
      <link>https://forums.autodesk.com/t5/net-forum/exception-thrown-could-not-load-assembly-in-autocad-2025-net-8/m-p/13744010#M85546</link>
      <description>&lt;P&gt;If AutoCAD is using ClosedXML, You can reference that assembly in rhe AutoCAD program folder.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 29 Jul 2025 06:53:47 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/exception-thrown-could-not-load-assembly-in-autocad-2025-net-8/m-p/13744010#M85546</guid>
      <dc:creator>ActivistInvestor</dc:creator>
      <dc:date>2025-07-29T06:53:47Z</dc:date>
    </item>
    <item>
      <title>Re: Exception thrown could not load assembly in AutoCAD 2025 .NET 8</title>
      <link>https://forums.autodesk.com/t5/net-forum/exception-thrown-could-not-load-assembly-in-autocad-2025-net-8/m-p/13809197#M85751</link>
      <description>&lt;P&gt;You just saved me from going crazy&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":beaming_face_with_smiling_eyes:"&gt;😁&lt;/span&gt;&lt;/P&gt;&lt;P&gt;I suffered on such exceptions in other contexts as well. Never came to the idea, ADSK would use them as well and to check the versions....&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 13 Sep 2025 11:04:30 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/exception-thrown-could-not-load-assembly-in-autocad-2025-net-8/m-p/13809197#M85751</guid>
      <dc:creator>dba78</dc:creator>
      <dc:date>2025-09-13T11:04:30Z</dc:date>
    </item>
    <item>
      <title>Re: Exception thrown could not load assembly in AutoCAD 2025 .NET 8</title>
      <link>https://forums.autodesk.com/t5/net-forum/exception-thrown-could-not-load-assembly-in-autocad-2025-net-8/m-p/13909777#M86174</link>
      <description>&lt;P&gt;Just a minor correction: AutoCAD 2025 use the 0.10&lt;STRONG&gt;2&lt;/STRONG&gt;.3 version of ClosedXML, not 0.100.3.&amp;nbsp;Strangely enough, they fell back to 0.102.2 in 2026.&lt;/P&gt;</description>
      <pubDate>Tue, 18 Nov 2025 14:32:13 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/exception-thrown-could-not-load-assembly-in-autocad-2025-net-8/m-p/13909777#M86174</guid>
      <dc:creator>FRFR1426</dc:creator>
      <dc:date>2025-11-18T14:32:13Z</dc:date>
    </item>
  </channel>
</rss>

