pyrevitlabs/pyRevit

CLI Extend Method - Fails in 4.8.14, works in 4.8.13

b-nicholson opened this issue · 5 comments

🚧 If you have SentinelOne installed as an antivirus, look no further.
You will need to create exceptions for Revit and pyRevit, both on the software and the %appdata% folders.

✈ Pre-Flight checks

  • I don't have SentinelOne antivirus installed (see above for the solution)
  • I have searched in the issues (open and closed) but couldn't find a similar issue
  • I have searched in the pyRevit Forum for similar issues
  • I already followed the installation troubleshooting guide thoroughly
  • I am using the latest pyRevit Version

🐞 Describe the bug

Using the CLI utility, I have been installing custom extensions using the Extend method. When upgrading to 4.8.14, the extend method now fails, where it had previously worked. It's indicating a dll issue with LibGit2Sharp, specifically there seems to be a versioning conflict.

C:\Users\User>pyrevit extend ui "Test" https://github.com/ErikFrits/EF-Tools --dest="%AppData%\pyRevit\Extensions" --branch="main" --debug
--dest = C:\Users\User\AppData\Roaming\pyRevit\Extensions
--branch = main
extend = True
<extension_name> = Test
ui = True
<repo_url> = https://github.com/ErikFrits/EF-Tools
Debug: Checking for all: wiki
Debug: Missing: wiki
Debug: Checking for all: blog
Debug: Missing: blog
Debug: Checking for all: docs
Debug: Missing: docs
Debug: Checking for all: source
Debug: Missing: source
Debug: Checking for all: youtube
Debug: Missing: youtube
Debug: Checking for all: support
Debug: Missing: support
Debug: Checking for all: env
Debug: Missing: env
Debug: Checking for all: update
Debug: Missing: update
Debug: Checking for all: clone
Debug: Missing: clone
Debug: Checking for all: clones
Debug: Missing: clones
Debug: Checking for all: attach
Debug: Missing: attach
Debug: Checking for all: detach
Debug: Missing: detach
Debug: Checking for all: attached
Debug: Missing: attached
Debug: Checking for all: switch
Debug: Missing: switch
Debug: Checking for all: extend
Debug: Checking for any: ui,lib
Debug: Matching: ui
Error: Could not load file or assembly 'LibGit2Sharp, Version=0.29.0.0, Culture=neutral, PublicKeyToken=7cbde695407f0333' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040) (System.IO.FileLoadException)
   at pyRevitLabs.PyRevit.PyRevitExtensions.InstallExtension(String extensionName, PyRevitExtensionTypes extensionType, String repoPath, String destPath, String branchName, GitInstallerCredentials credentials)
   at pyRevitCLI.PyRevitCLI.ProcessArguments()
   at pyRevitCLI.PyRevitCLI.Main(String[] args)

♻️ To Reproduce

Steps to reproduce the behavior:

  1. Install pyRevit 4.8.13
  2. using CMD, enter the following command: pyrevit extend ui "Test" https://github.com/ErikFrits/EF-Tools --dest="%AppData%\pyRevit\Extensions" --branch="main" --debug
  3. It installs perfectly
  4. Install pyRevit 4.8.14
  5. Repeat the same cmd command, it now fails.

⏲️ Expected behavior

Clone the github repo to the desired directory and update the pyrevit settings to suit, as per prior releases.

🖼 Screenshots of the issue

See bug description.

🖥️ Hardware and Software Setup (please complete the following information)

  • Windows version [11]
  • pyRevit Version [4.8.14]
  • pyRevit Environment:
==> Registered Clones (full git repos)
==> Registered Clones (deployed from archive/image)
master | Deploy: "basepublic" | Branch: "master" | Version: "4.8.14.24016+1909" | Path: "C:\Users\User\AppData\Roaming\pyRevit-Master"
==> Attachments
master | Product: "2022 First Customer Ship" | Engine: IPY277 (277) | Path: "C:\Users\User\AppData\Roaming\pyRevit-Master"
master | Product: "Autodesk Revit 2021" | Engine: IPY277 (277) | Path: "C:\Users\User\AppData\Roaming\pyRevit-Master"
==> Installed Extensions
==> Default Extension Search Path
C:\Users\User\AppData\Roaming\pyRevit\Extensions
==> Extension Search Paths
==> Extension Sources - Default
https://github.com/eirannejad/pyRevit/raw/master/extensions/extensions.json
==> Extension Sources - Additional
==> Installed Revits
2022 First Customer Ship | Version: 22.0.2.392 | Build: 20210224_1515(x64) | Language: 1033 | Path: "C:\Program Files\Autodesk\Revit 2022\"
Autodesk Revit 2021 | Version: 21.1.1.109 | Build: 20200715_1022(x64) | Language: 1033 | Path: "C:\Program Files\Autodesk\Revit 2021\"
==> Running Revit Instances
==> User Environment
Microsoft Windows 10 [Version 10.0.22000]
Executing User: WINDEV2210EVAL\User
Active User:
Admin Access: No
%APPDATA%: "C:\Users\User\AppData\Roaming"
Latest Installed .Net Framework: 4.8
Installed .Net Target Packs: v4.0 v4.5 v4.5.1 v4.5.2 v4.6 v4.6.1 v4.7.2 v4.X
Installed .Net-Core Target Packs: v6.0.402
pyRevit CLI v4.8.14.24016+1909.ee814ee2f686d23db8bb6ff80d8bb918ff9adc99

Additional context

N/A

HI @b-nicholson, I'm sorry you experienced this error.

Does this apply also to a fresh install of pyrevit 4.8.14?
Instead of installing it over the 4.8.13 version, first uninstall it and remove the pyRevit and pyrevit-master folders in %appdata%.

As always, to be safe try to reboot the pc to see if the issue persists.

Hi! yes, this also applies to fresh installs.

This was happening back when 4.8.14 was first released, @jmcouffin fixed it by downgrading LibGit2Sharp to 0.26.2 in PR #2062. I don't know if it was merged to master.

This was happening back when 4.8.14 was first released, @jmcouffin fixed it by downgrading LibGit2Sharp to 0.26.2 in PR #2062. I don't know if it was merged to master.

It was not merged to the Master branch as this is aimed at major released but it has beeen fixed and shipped with the latest wip installer that you can get here at the bottom of the page: https://github.com/eirannejad/pyRevit/actions/runs/8039397768
Tested on my side, it is up and running.

thanks for bringing this to my attention @iorhanV