pyrevitlabs / pyRevit

Rapid Application Development (RAD) Environment for Autodesk Revit®
http://wiki.pyrevitlabs.io
GNU General Public License v3.0
1.28k stars 331 forks source link

MahApps.Metro version conflict with CTC HIVE for Revit #442

Closed wyattc closed 5 years ago

wyattc commented 5 years ago

Issue Description

After installation of pyRevit 4.6.8, the HIVE addin for Revit appears black. Upon further investigation, I found that the MahApps.Metro.dll is of a newer version in pyRevit. I also found that pyRevit functions correctly with the older version however, HIVE still does not appear correctly, Disabling the pyRevit addin allows the HIVE addin to load and function. I also found that if I load pyRevit after Revit and HIVE have loaded, HIVE continues to function correctly.

We are investigating a solution. If there is something you might be able to do on your end, it would be great to hear.

Environment


==> Registered Clones (full git repos)
==> Registered Clones (deployed from archive)
Name: "master" | Deploy: "basepublic" | Path: "C:\Program Files\pyRevit-Master"
==> Attachments
Autodesk Revit 2018 First Customer Ship | Clone: "master" | Engine: "277"
Autodesk Revit 2019.1 | Clone: "master" | Engine: "277"
==> Installed UI Extensions
==> Installed Library Extensions
==> Extension Search Paths
==> Extension Sources - Default
https://github.com/eirannejad/pyRevit/raw/master/extensions/extensions.json
==> Extension Sources - Additional
==> Installed Revits
Autodesk Revit 2018 First Customer Ship | Version: 18.0.0.420 | Language: 1033 | Path: "C:\Program Files\Autodesk\Revit 2018\"
Autodesk Revit 2019.1 | Version: 19.1.0.112 | Language: 1033 | Path: "C:\Program Files\Autodesk\Revit 2019\"
==> Running Revit Instances
PID: 18144 | Autodesk Revit 2019.1 | Version: 19.1.0.112 | Language: 0 | Path: "C:\Program Files\Autodesk\Revit 2019"```
eirannejad commented 5 years ago

Thanks for the report!

A quick solution is to rename the .addin file for HIVE to something that is alphabetically before pyRevit.addin. the HIVE will be loaded first.

I'll see what I can do on my side.

eirannejad commented 5 years ago

Could you possibly figure out what Mahapps version HIVE is using?

wyattc commented 5 years ago

HIVE uses 1.5.0.23 of the dll and includes it in the addin bundle folder. the name of the manifest is CTC-Hive-Suite.addin which means it's already alphabetically first. It loads from the addins folder in ProgramData, not in the userdata location like pyRevit. I have not tested this yet, perhaps i'll try loading from ProgramData.

eirannejad commented 5 years ago

Addins in %programdata% should load first. Maybe change pyRevit.addin to ZZZpyRevit.addin and test? Thanks for the hive dll info

wyattc commented 5 years ago

Renaming didn't affect it. Am i correct in stating that pyRevit loads on app start? HIVE doesn't use the UI dll until the button is pushed to open it. I am going to test another 'loading' scenario. Will post the result.

eirannejad commented 5 years ago

Yes. pyRevit loads its dlls on start so the environment is ready. HIVE should really compile the product against the specific dll version. Is there a *.dll.config file in the HIVE folder? that config file tells the dll binder what dll versions are allowed.

wyattc commented 5 years ago

Okay, I may have found another way to make them both work, assuming pyRevit is okay to use the older .dll: Our tool suites use a common location for .dll that they share. Although this one is not used by any of our other apps (yet), we will move it to the common location for future releases. we will also investigate what breaking changes there were with the newer version and HIVE. Thank you for your time in helping to figure this out. Will update you with our solution. Please let me know if you encounter any issues with the older version of MahApps and pyRevit.

eirannejad commented 5 years ago

Sure thing. Should this be closed then?

wyattc commented 5 years ago

I have a solution but it requires a little manual labor:

  1. Go to the addin folder for your version(s) of Revit – for example: C:\ProgramData\Autodesk\Revit\Addins\2019\CTC-Hive-Suite.bundle\Contents
  2. Find the file called MahApps.Metro.dll and move it to C:\ProgramData\CTC\CommonRevit
  3. For all other versions of revit, find that .dll again and remove it from the Contents folders
  4. Start Revit and verify that the UI looks okay for HIVE
  5. If it doesn’t, double check your steps
  6. Test the pyRevit apps to verify they work correctly. I tested some that use a GUI and they all seemed fine.

We will have an update to HIVE in a couple weeks and with it the commonrevit location of the mahapps dll will be changed.

wyattc commented 5 years ago

Sure thing. Should this be closed then?

I think it's okay to close. Just wanted to put the steps up for others that might encounter this issue. thanks for your help!