<?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: NuGet Package DLL Loading Issue in .NET Forum</title>
    <link>https://forums.autodesk.com/t5/net-forum/nuget-package-dll-loading-issue/m-p/13058737#M2423</link>
    <description>&lt;P&gt;@&amp;nbsp;jeremyperna7254 and others&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It's great that you were able to use the solution provided to solve your issue.&lt;BR /&gt;&lt;BR /&gt;To my way of thinking you should be applying the solved credit to the poster of the solution, not to yourself.&lt;BR /&gt;What you have done is essentially stealing credit for someone elses knowledge and effort.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;This is a peer to peer support group; unpaid and usually unthanked and uncredited.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If users continue to not thank or credit the people who take the time to decipher questions and attempt to resolve issues,&amp;nbsp; these users shouldn't be surprised if, before long, thay are ignored.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 02 Oct 2024 04:57:12 GMT</pubDate>
    <dc:creator>kerry_w_brown</dc:creator>
    <dc:date>2024-10-02T04:57:12Z</dc:date>
    <item>
      <title>NuGet Package DLL Loading Issue</title>
      <link>https://forums.autodesk.com/t5/net-forum/nuget-package-dll-loading-issue/m-p/13058174#M2420</link>
      <description>&lt;P&gt;In a test project I am working on I am trying to use the FontAwesome.WPF NuGet package for icons to be displayed on a palette control. Here is the current solution structure&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Solution&lt;/P&gt;&lt;P&gt;- Core.csproj (references UI.csproj for views)&lt;/P&gt;&lt;P&gt;- UI.csproj (the project that references the FontAwesome.WPF package)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In the WPF UserControl that needs the icons I have added the namespace declaration and usage of the icons like this&lt;/P&gt;&lt;LI-CODE lang="general"&gt;xmlns:fa="http://schemas.fontawesome.io/icons/"
...
&amp;lt;fa:ImageAwesome
    Icon="Plus"
    Width="16" Height="16"
    Margin="0 0 5 0"/&amp;gt;
&amp;lt;TextBlock Text="Connect To Existing Project" /&amp;gt;&lt;/LI-CODE&gt;&lt;P&gt;Everything in the XAML designer renders fine. However, when I NETLOAD my plugin from bin/Debug/Core.dll and then trigger the command that shows my palette with the icons I get the following error at the InitializeComponent method in the code-behind my user control&lt;/P&gt;&lt;LI-CODE lang="general"&gt;System.Windows.Markup.XamlParseException
  HResult=0x80131501
  Message=Could not load file or assembly 'FontAwesome.WPF, PublicKeyToken=0758b07a11a4f466' or one of its dependencies. The system cannot find the file specified.
  Source=PresentationFramework
  StackTrace:
   at System.Windows.Markup.XamlReader.RewrapException(Exception e, IXamlLineInfo lineInfo, Uri baseUri)
   at System.Windows.Markup.WpfXamlLoader.Load(XamlReader xamlReader, IXamlObjectWriterFactory writerFactory, Boolean skipJournaledProperties, Object rootObject, XamlObjectWriterSettings settings, Uri baseUri)
   at System.Windows.Markup.WpfXamlLoader.LoadBaml(XamlReader xamlReader, Boolean skipJournaledProperties, Object rootObject, XamlAccessLevel accessLevel, Uri baseUri)
   at System.Windows.Markup.XamlReader.LoadBaml(Stream stream, ParserContext parserContext, Object parent, Boolean closeStream)
   at UI.View.ProjectTabView.InitializeComponent() in C:\Users\jerem\source\repos\PluginUIDemo\UI\View\ProjectTabView.xaml:line 1

  This exception was originally thrown at this call stack:
    [External Code]

Inner Exception 1:
FileNotFoundException: Could not load file or assembly 'FontAwesome.WPF, PublicKeyToken=0758b07a11a4f466' or one of its dependencies. The system cannot find the file specified.&lt;/LI-CODE&gt;&lt;P&gt;Now the part where I get really confused is that I have confirmed that the FontAwesome.WPF.dll is present in my output directory (bin/Debug/FontAwesome.WPF.dll). I also am referencing a MVVM NuGet package in UI.csproj in the same way and that works just fine (however the difference is this isn't being loaded during initialization of a user control).&lt;/P&gt;&lt;LI-CODE lang="general"&gt;  &amp;lt;ItemGroup&amp;gt;
    &amp;lt;PackageReference Include="CommunityToolkit.Mvvm"&amp;gt;
      &amp;lt;Version&amp;gt;8.3.2&amp;lt;/Version&amp;gt;
    &amp;lt;/PackageReference&amp;gt;
    &amp;lt;PackageReference Include="FontAwesome.WPF"&amp;gt;
      &amp;lt;Version&amp;gt;4.7.0.9&amp;lt;/Version&amp;gt;
    &amp;lt;/PackageReference&amp;gt;
  &amp;lt;/ItemGroup&amp;gt;&lt;/LI-CODE&gt;&lt;P&gt;Interestingly, I can fix this error by manually copying the FontAwesome.WPF.dll into the&amp;nbsp;C:\Program Files\Autodesk\AutoCAD 2024 directory, which confirms that is where ACAD is looking for this package. What I don't understand is why ACAD is looking for this package in the program files directory (C:\Program Files\Autodesk\AutoCAD 2024) and not in the bin/Debug output directory where I indicated that my plugin dll is and all the other dlls that mine depends on are located. Is there something different about loading assemblies for user controls?&lt;/P&gt;</description>
      <pubDate>Tue, 01 Oct 2024 20:47:41 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/nuget-package-dll-loading-issue/m-p/13058174#M2420</guid>
      <dc:creator>jeremyperna7254</dc:creator>
      <dc:date>2024-10-01T20:47:41Z</dc:date>
    </item>
    <item>
      <title>Re: NuGet Package DLL Loading Issue</title>
      <link>https://forums.autodesk.com/t5/net-forum/nuget-package-dll-loading-issue/m-p/13058275#M2421</link>
      <description>&lt;P&gt;In many scenarios I've had to deal with, involving multiple managed extension apps that were all dependent on a common set of libraries, I use something like the following (which is vastly-simplified from the actual working code, which searches through the Applications subkey of the registry to find dependent assemblies).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This overly-simplified example should find and load a dependent .dll having the same location as the .dll containing the IExtensionApplication.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;public class MyApplication : IExtensionApplication
{
   string myLocation;
   public void Initialize()
   {
      string path = typeof(MyApplication).Assembly.Location;
      myLocation = Path.GetDirectoryName(path);
      AssemblyLoadContext.Default.Resolving += OnResolve;
   }

   Assembly OnResolve(AssemblyLoadContext context, AssemblyName name)
   {
      string path = Path.Combine(myLocation, $"{name.Name}.dll");
      if(File.Exists(path))
      {
         return context.LoadFromAssemblyPath(path);
      }
      return null;
   }

   public void Terminate()
   {
   }
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 01 Oct 2024 22:58:17 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/nuget-package-dll-loading-issue/m-p/13058275#M2421</guid>
      <dc:creator>ActivistInvestor</dc:creator>
      <dc:date>2024-10-01T22:58:17Z</dc:date>
    </item>
    <item>
      <title>Re: NuGet Package DLL Loading Issue</title>
      <link>https://forums.autodesk.com/t5/net-forum/nuget-package-dll-loading-issue/m-p/13058549#M2422</link>
      <description>&lt;P&gt;I took your idea of adding an event handler to the assembly resolution failure event and got it working with this code. Thank you so much for the response!&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;    public class Program : IExtensionApplication
    {
        private string _rootDirectory;

        public void Initialize()
        {
            string path = typeof(Program).Assembly.Location;
            _rootDirectory = Path.GetDirectoryName(path);
            AppDomain.CurrentDomain.AssemblyResolve += OnResolve;
        }

        private Assembly OnResolve(object sender, ResolveEventArgs args)
        {
            AssemblyName assemblyName = new AssemblyName(args.Name);
            string path = Path.Combine(_rootDirectory, $"{assemblyName.Name}.dll");
            if (File.Exists(path))
            {
                return Assembly.LoadFile(path);
            }
            return null;
        }

        public void Terminate() { }
    }&lt;/LI-CODE&gt;</description>
      <pubDate>Wed, 02 Oct 2024 01:45:40 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/nuget-package-dll-loading-issue/m-p/13058549#M2422</guid>
      <dc:creator>jeremyperna7254</dc:creator>
      <dc:date>2024-10-02T01:45:40Z</dc:date>
    </item>
    <item>
      <title>Re: NuGet Package DLL Loading Issue</title>
      <link>https://forums.autodesk.com/t5/net-forum/nuget-package-dll-loading-issue/m-p/13058737#M2423</link>
      <description>&lt;P&gt;@&amp;nbsp;jeremyperna7254 and others&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It's great that you were able to use the solution provided to solve your issue.&lt;BR /&gt;&lt;BR /&gt;To my way of thinking you should be applying the solved credit to the poster of the solution, not to yourself.&lt;BR /&gt;What you have done is essentially stealing credit for someone elses knowledge and effort.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;This is a peer to peer support group; unpaid and usually unthanked and uncredited.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If users continue to not thank or credit the people who take the time to decipher questions and attempt to resolve issues,&amp;nbsp; these users shouldn't be surprised if, before long, thay are ignored.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 02 Oct 2024 04:57:12 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/nuget-package-dll-loading-issue/m-p/13058737#M2423</guid>
      <dc:creator>kerry_w_brown</dc:creator>
      <dc:date>2024-10-02T04:57:12Z</dc:date>
    </item>
    <item>
      <title>Re: NuGet Package DLL Loading Issue</title>
      <link>https://forums.autodesk.com/t5/net-forum/nuget-package-dll-loading-issue/m-p/13058994#M2424</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/10162603"&gt;@jeremyperna7254&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;&lt;P&gt;I took your idea of adding an event handler to the assembly resolution failure event and got it working with this code.&amp;nbsp;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;IOW, you took the code I posted and just renamed a few identifiers/variables?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Good Job!&lt;/P&gt;</description>
      <pubDate>Wed, 02 Oct 2024 08:56:38 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/nuget-package-dll-loading-issue/m-p/13058994#M2424</guid>
      <dc:creator>ActivistInvestor</dc:creator>
      <dc:date>2024-10-02T08:56:38Z</dc:date>
    </item>
    <item>
      <title>Re: NuGet Package DLL Loading Issue</title>
      <link>https://forums.autodesk.com/t5/net-forum/nuget-package-dll-loading-issue/m-p/13059659#M2425</link>
      <description>&lt;P&gt;Oh my goodness! I am so sorry! That was a complete misclick. Of course the credit should go to&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/4476837"&gt;@ActivistInvestor&lt;/a&gt;. I just wanted to post the exact code that worked for me but I didn't intend to mark my reply as the accepated solution. I have marked&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/4476837"&gt;@ActivistInvestor&lt;/a&gt;'s reply as the accepted solution now. Thank you for pointing out the mistake and so sorry for the mess up. I really, really appreciate how engaged this forum is and all the helpful users. I definitely want to give credit for all the help you all provide.&lt;/P&gt;</description>
      <pubDate>Wed, 02 Oct 2024 13:01:18 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/nuget-package-dll-loading-issue/m-p/13059659#M2425</guid>
      <dc:creator>jeremyperna7254</dc:creator>
      <dc:date>2024-10-02T13:01:18Z</dc:date>
    </item>
    <item>
      <title>Re: NuGet Package DLL Loading Issue</title>
      <link>https://forums.autodesk.com/t5/net-forum/nuget-package-dll-loading-issue/m-p/14003452#M86514</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/4476837"&gt;@ActivistInvestor&lt;/a&gt;&amp;nbsp;, I'm not sure how your solution actually works in a robust way. I thought AssemblyLoadContext.Default.Resolving will not&amp;nbsp;not safely isolate dependencies per plugin, due to the fact that it is global across the host application.&amp;nbsp; The first one that wins pollutes the process, and the other can break, isn't that the case?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However, it just works on my testing thus far!! Anything that I miss?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 04 Feb 2026 06:32:15 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/nuget-package-dll-loading-issue/m-p/14003452#M86514</guid>
      <dc:creator>soonhui</dc:creator>
      <dc:date>2026-02-04T06:32:15Z</dc:date>
    </item>
    <item>
      <title>Re: NuGet Package DLL Loading Issue</title>
      <link>https://forums.autodesk.com/t5/net-forum/nuget-package-dll-loading-issue/m-p/14003839#M86515</link>
      <description>&lt;P&gt;If there are multiple handlers for the event, they are called in the order that they were added to the event, and the first one that returns an Assembly&amp;nbsp; 'wins', and any remaining handlers do not get called.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 04 Feb 2026 09:36:02 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/nuget-package-dll-loading-issue/m-p/14003839#M86515</guid>
      <dc:creator>ActivistInvestor</dc:creator>
      <dc:date>2026-02-04T09:36:02Z</dc:date>
    </item>
    <item>
      <title>Re: NuGet Package DLL Loading Issue</title>
      <link>https://forums.autodesk.com/t5/net-forum/nuget-package-dll-loading-issue/m-p/14003876#M86516</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/4476837"&gt;@ActivistInvestor&lt;/a&gt;&amp;nbsp;, but isn't that dangerous ( and not robust in solving the problem)? Because the winner will take over the rest and then we might have the original problem. And given that it's all indeterministic on how they are called, the problem may or may not be manifested&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 04 Feb 2026 10:01:07 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/nuget-package-dll-loading-issue/m-p/14003876#M86516</guid>
      <dc:creator>soonhui</dc:creator>
      <dc:date>2026-02-04T10:01:07Z</dc:date>
    </item>
  </channel>
</rss>

