<?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 Confusing assembly location when use one assembly for two Revit-Addin projects in Revit API Forum</title>
    <link>https://forums.autodesk.com/t5/revit-api-forum/confusing-assembly-location-when-use-one-assembly-for-two-revit/m-p/9070114#M39402</link>
    <description>&lt;P&gt;Hi everybody,&lt;/P&gt;&lt;P&gt;I create a project as library to make custom classes and functions, then I use this library reference to two Revit-Addin projects.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Because I want to install&amp;nbsp; each project separately so each project should contain their own library assembly in their setup folder. In this way, I can easily manage every single project without caring about others.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I use method &lt;FONT color="#0000FF"&gt;Assembly.GetExecutingAssembly()&lt;/FONT&gt; to check where the library.dll is referring to. When I first run the project 1, I get the correct assembly path - the project 1 folder. Then I run project 2 and get the unexpected result, the path is in the project 1 folder again.&amp;nbsp;This should return project 2 folder as my expectation. The similar problem occur if i run the project 2 first.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#808080"&gt;In my knowledge, I guess after I run the project 1, the assembly path have save in computer memory. Then when I run the project 2, the code get the reference in computer memory and return unexpected result.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#808080"&gt;Is anyone here have had same problem? Can you give me solution? I would like to attach my Solution here for your information&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#808080"&gt;Thank a lot!&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;P/s: Here are some screen shots&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Add Assembly.PNG" style="width: 376px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/685021iB9495502D18EC596/image-size/large?v=v2&amp;amp;px=999" role="button" title="Add Assembly.PNG" alt="Add Assembly.PNG" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Add Assembly2.PNG" style="width: 999px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/685022iAFEECF911B44B781/image-size/large?v=v2&amp;amp;px=999" role="button" title="Add Assembly2.PNG" alt="Add Assembly2.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Mon, 07 Oct 2019 03:31:40 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2019-10-07T03:31:40Z</dc:date>
    <item>
      <title>Confusing assembly location when use one assembly for two Revit-Addin projects</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/confusing-assembly-location-when-use-one-assembly-for-two-revit/m-p/9070114#M39402</link>
      <description>&lt;P&gt;Hi everybody,&lt;/P&gt;&lt;P&gt;I create a project as library to make custom classes and functions, then I use this library reference to two Revit-Addin projects.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Because I want to install&amp;nbsp; each project separately so each project should contain their own library assembly in their setup folder. In this way, I can easily manage every single project without caring about others.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I use method &lt;FONT color="#0000FF"&gt;Assembly.GetExecutingAssembly()&lt;/FONT&gt; to check where the library.dll is referring to. When I first run the project 1, I get the correct assembly path - the project 1 folder. Then I run project 2 and get the unexpected result, the path is in the project 1 folder again.&amp;nbsp;This should return project 2 folder as my expectation. The similar problem occur if i run the project 2 first.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#808080"&gt;In my knowledge, I guess after I run the project 1, the assembly path have save in computer memory. Then when I run the project 2, the code get the reference in computer memory and return unexpected result.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#808080"&gt;Is anyone here have had same problem? Can you give me solution? I would like to attach my Solution here for your information&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#808080"&gt;Thank a lot!&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;P/s: Here are some screen shots&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Add Assembly.PNG" style="width: 376px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/685021iB9495502D18EC596/image-size/large?v=v2&amp;amp;px=999" role="button" title="Add Assembly.PNG" alt="Add Assembly.PNG" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Add Assembly2.PNG" style="width: 999px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/685022iAFEECF911B44B781/image-size/large?v=v2&amp;amp;px=999" role="button" title="Add Assembly2.PNG" alt="Add Assembly2.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 07 Oct 2019 03:31:40 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/confusing-assembly-location-when-use-one-assembly-for-two-revit/m-p/9070114#M39402</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-10-07T03:31:40Z</dc:date>
    </item>
    <item>
      <title>Re: Confusing assembly location when use one assembly for two Revit-Addin projec</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/confusing-assembly-location-when-use-one-assembly-for-two-revit/m-p/9070282#M39403</link>
      <description>&lt;P&gt;If you load an assembly A into the .NET framework from directory Da and then load another version of assembly A from a different location Db, the .NET framework will determine that A has already been loaded and reuse the existing instance from Da, ignoring your request to load a second instance from Db. There are ways to work around this, presumably, but I will not even try to dive into that. I suggest that you design your two add-ins so that they do not rely on the location of the assembly A that you load in any way. You can easily move your assembly location determination code out of A into the main two add-ins instead.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 07 Oct 2019 07:13:41 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/confusing-assembly-location-when-use-one-assembly-for-two-revit/m-p/9070282#M39403</guid>
      <dc:creator>jeremytammik</dc:creator>
      <dc:date>2019-10-07T07:13:41Z</dc:date>
    </item>
  </channel>
</rss>

