<?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: Our addin cannot load `Newtonsoft.Json.dll` due to error in Inventor's app.config in Inventor Programming Forum</title>
    <link>https://forums.autodesk.com/t5/inventor-programming-forum/our-addin-cannot-load-newtonsoft-json-dll-due-to-error-in/m-p/12124556#M20975</link>
    <description>&lt;P&gt;Hello ,&lt;/P&gt;&lt;P&gt;my addin is also an dll, executed in Inventor.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Manfred&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 25 Jul 2023 10:54:10 GMT</pubDate>
    <dc:creator>M.Zirk</dc:creator>
    <dc:date>2023-07-25T10:54:10Z</dc:date>
    <item>
      <title>Our addin cannot load `Newtonsoft.Json.dll` due to error in Inventor's app.config</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/our-addin-cannot-load-newtonsoft-json-dll-due-to-error-in/m-p/12121880#M20972</link>
      <description>&lt;P&gt;Hello Inventor dev community,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;we are having a problem with an Inventor addin we are developing using the .NET Inventor API.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Our addin tries to load `Newtonsoft.Json.dll` version 6, which we ship together with our addin.&lt;/P&gt;&lt;P&gt;However, Inventor ships its own (newer) version of this DLL in its application folder:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="general"&gt;C:\Program Files\Autodesk\Inventor 2022\Bin\Newtonsoft.Json.dll&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Inventor also defines a .NET `bindingRedirect` to this newer DLL version in its `app.config` file:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="general"&gt;C:\Program Files\Autodesk\Inventor 2022\Bin\Inventor.exe.config&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is all fine, except that in certain Inventor versions, the `app.config` points its `bindingRedirect` to a different DLL version than the DLL that Inventor actually provides:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Inventor 2022:&lt;/STRONG&gt; `bindingRedirect` to DLL version &lt;STRONG&gt;10&lt;/STRONG&gt;, and ships DLL version &lt;STRONG&gt;10&lt;/STRONG&gt; --&amp;gt; OK.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Inventor 2022.3.1:&lt;/STRONG&gt; `bindingRedirect` to DLL version &lt;STRONG&gt;10&lt;/STRONG&gt;, but ships DLL version &lt;STRONG&gt;12&lt;/STRONG&gt; --&amp;gt; ERROR!&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Inventor 2022.4:&lt;/STRONG&gt; `bindingRedirect` to DLL version &lt;STRONG&gt;10&lt;/STRONG&gt;, but ships DLL version &lt;STRONG&gt;12&lt;/STRONG&gt; --&amp;gt; ERROR!&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Inventor 2022.5:&lt;/STRONG&gt; `bindingRedirect` to DLL version &lt;STRONG&gt;10&lt;/STRONG&gt;, but ships DLL version &lt;STRONG&gt;12&lt;/STRONG&gt; --&amp;gt; ERROR!&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Inventor 2023:&lt;/STRONG&gt; `bindingRedirect` to DLL version &lt;STRONG&gt;12&lt;/STRONG&gt;, and ships DLL version &lt;STRONG&gt;12&lt;/STRONG&gt; --&amp;gt; OK.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What happens in the Inventor versions with the mismatch, is that .NET sees the `bindingRedirect`, and therefore flat-out refuses to load our addin's version 6 of the DLL, and instead goes looking for a version 10 - but then can't find this version anywhere. So we get a `FileNotFoundException`, and our addin becomes non-functional.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is there any possible valid reason for some Inventor versions have this DLL version mismatch?&lt;/P&gt;&lt;P&gt;It seems like a bug to me, like the Inventor devs updated the DLL but forgot to update their `app.config` accordingly.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Our addin can't be the only code affected by this, right? There must be a reason why Inventor ships its own copy of this DLL - some AutoDesk functionality or addin must need it (no idea what though), and that functionality would also be broken by this mismatch in the same way that our addin is.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How should we procede?&lt;/P&gt;</description>
      <pubDate>Mon, 24 Jul 2023 11:23:34 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/our-addin-cannot-load-newtonsoft-json-dll-due-to-error-in/m-p/12121880#M20972</guid>
      <dc:creator>scharrerVHKNR</dc:creator>
      <dc:date>2023-07-24T11:23:34Z</dc:date>
    </item>
    <item>
      <title>Betreff: Our addin cannot load `Newtonsoft.Json.dll` due to error in Inventor's app.config</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/our-addin-cannot-load-newtonsoft-json-dll-due-to-error-in/m-p/12122449#M20973</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;ususally you add your desired newtonsoft.dll to your vb. project by NuGet Manager and copy it during compilation into your addin output directory.&lt;/P&gt;&lt;P&gt;Mark in VB. project for your appilication settings "generate binding redirections automatically".&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For me inventor should use it own newtonsoft.dll and your addin should also use its own newtonsoft.dll.&lt;/P&gt;&lt;P&gt;Im my addin i use newtonsoft.dll version 13 and Inventor uses version 12. And there are no problems.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm not sure if this work fine also with Inventor 2022.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Maybe that helps.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Manfred&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 24 Jul 2023 15:08:39 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/our-addin-cannot-load-newtonsoft-json-dll-due-to-error-in/m-p/12122449#M20973</guid>
      <dc:creator>M.Zirk</dc:creator>
      <dc:date>2023-07-24T15:08:39Z</dc:date>
    </item>
    <item>
      <title>Re: Our addin cannot load `Newtonsoft.Json.dll` due to error in Inventor's app.config</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/our-addin-cannot-load-newtonsoft-json-dll-due-to-error-in/m-p/12124354#M20974</link>
      <description>&lt;P&gt;The addin is not a separate application, it's a DLL that implements the `Inventor.ApplicationAddInServer` COM interface, as shown here:&lt;BR /&gt;&lt;A href="https://help.autodesk.com/view/INVNTOR/2022/ENU/?guid=GUID-52422162-1784-4E8F-B495-CDB7BE9987AB" target="_blank"&gt;https://help.autodesk.com/view/INVNTOR/2022/ENU/?guid=GUID-52422162-1784-4E8F-B495-CDB7BE9987AB&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Inventor loads the addin into the Inventor process, and thus the binding redirections defined in `Inventor.exe.config` apply.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I don't think it's possible for an in-process DLL to have its own binding redirections, or am I mistaken?&lt;/P&gt;</description>
      <pubDate>Tue, 25 Jul 2023 09:13:27 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/our-addin-cannot-load-newtonsoft-json-dll-due-to-error-in/m-p/12124354#M20974</guid>
      <dc:creator>scharrerVHKNR</dc:creator>
      <dc:date>2023-07-25T09:13:27Z</dc:date>
    </item>
    <item>
      <title>Re: Our addin cannot load `Newtonsoft.Json.dll` due to error in Inventor's app.config</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/our-addin-cannot-load-newtonsoft-json-dll-due-to-error-in/m-p/12124556#M20975</link>
      <description>&lt;P&gt;Hello ,&lt;/P&gt;&lt;P&gt;my addin is also an dll, executed in Inventor.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Manfred&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 25 Jul 2023 10:54:10 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/our-addin-cannot-load-newtonsoft-json-dll-due-to-error-in/m-p/12124556#M20975</guid>
      <dc:creator>M.Zirk</dc:creator>
      <dc:date>2023-07-25T10:54:10Z</dc:date>
    </item>
  </channel>
</rss>

