Two versions of the same Revit 2018 Add-In conflict?

Two versions of the same Revit 2018 Add-In conflict?

Anonymous
Not applicable
473 Views
2 Replies
Message 1 of 3

Two versions of the same Revit 2018 Add-In conflict?

Anonymous
Not applicable

I'm developing Add-In for Revit and wanted to have two instances running simultanously: one version for debugging (DLL located in my project bin/debug folder) and the other is production version (DLL located in ProgramData). Both create ribbon panel - I understand that panels should have unique names, so production version creates panel named "Panel" and debug version - "Panel-Debug". Both add-ins have also completely different manifests:

<?xml version="1.0" encoding="utf-8"?>
<RevitAddIns>
  <AddIn Type="Application">
    <Name>MyAddin</Name>
    <Assembly>MyAddin.dll</Assembly>
    <FullClassName>MyAddin.Addin</FullClassName>
    <AddInId>F998FB70-A053-46B2-A9A6-310750B4FE8B</AddInId>
    <VendorId>MyAddin</VendorId>
    <VendorDescription>MyAddin</VendorDescription>
    <VisibilityMode>NotVisibleWhenNoActiveDocument</VisibilityMode>
  </AddIn>
</RevitAddIns>
<?xml version="1.0" encoding="utf-8"?>
<RevitAddIns>
  <AddIn Type="Application">
    <Name>MyAddin-Debug</Name>
    <Assembly>path\to\bin\debug\MyAddin.dll</Assembly>
    <FullClassName>MyAddin.AddinDebug</FullClassName>
    <AddInId>E13F825D-D91E-4537-9C42-2DDA6503D639</AddInId>
    <VendorId>MyAddin-Debug</VendorId>
    <VendorDescription>MyAddin-Debug</VendorDescription>
    <VisibilityMode>NotVisibleWhenNoActiveDocument</VisibilityMode>
  </AddIn>
</RevitAddIns>

 As you can see I even changed FullClassName for debug version. For some reason, when I launch Revit, I get the error: "The panel with name "Panel" already exists!". It looks like Revit tries to load production version of the DLL twice. I don't understand why is that? Both manifests point to completely different locations of the DLL. What am I doing wrong or don't understand?

0 Likes
474 Views
2 Replies
Replies (2)
Message 2 of 3

jeremy_tammik
Alumni
Alumni

The DLL assembly names must also differ.

 

There may well be yet more to it than that.

 

I would recommend not trying to do this.

 

You are fighting against the .NET system.

 

Going with the system will probably cause less pain.

 

Jeremy Tammik Developer Advocacy and Support + The Building Coder + Autodesk Developer Network + ADN Open
Message 3 of 3

franciscopossetto
Advocate
Advocate

Hey,

 

I had this error before, my mistake was to change the Assembly name manually (renaming the file) instead of change it from the project. If you change the  AssemblyName property from Project-> Properties -> Application it should works.

 

I also was changing the default Namespace property on one of the projects, but I at this moment I don't remember if it was necessary to avoid some conflicts or if I decide to change it for some other reason. In the case the Assembly name wouldn't be enough you can try this as well.

 

Good luck!

Github:
https://github.com/franpossetto
0 Likes