Skip to content

loading pyRevitLabs.json in PyrevitCLI manually if assembly is not found#2539

Merged
jmcouffin merged 4 commits intopyrevitlabs:developfrom
thumDer:dev/cli-assembly-resolve
Jan 24, 2025
Merged

loading pyRevitLabs.json in PyrevitCLI manually if assembly is not found#2539
jmcouffin merged 4 commits intopyrevitlabs:developfrom
thumDer:dev/cli-assembly-resolve

Conversation

@thumDer
Copy link
Copy Markdown
Contributor

@thumDer thumDer commented Jan 24, 2025

Name of your PR

Description

I couldn't make the CLI work from the develop branch, it always resulted in

❯ .\bin\pyrevit.exe env
==> Registered Clones (full git repos)
Error: Could not load file or assembly 'Newtonsoft.Json, Version=11.0.0.0, Culture=neutral, PublicKeyToken=null'. The system cannot find the file specified.
Run with "--debug" option to see debug messages

The only way I've found to solve this issue is to explicitly force assembly resolution.


Checklist

Before submitting your pull request, ensure the following requirements are met:

  • Code follows the PEP 8 style guide.
  • Code has been formatted with Black using the command:
    pipenv run black {source_file_or_directory}
  • Changes are tested and verified to work as expected.

Thank you for contributing to pyRevit! 🎉

@devloai
Copy link
Copy Markdown
Contributor

devloai bot commented Jan 24, 2025

Automatic code review is enabled for this repository. Reviewing this PR now.

Copy link
Copy Markdown
Contributor

@devloai devloai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've reviewed the changes for manually loading the Newtonsoft.Json assembly. The solution effectively addresses the reported issue. I've suggested some improvements to make the assembly matching more precise and add helpful debug logging. The changes look good overall and solve the core problem.

Co-authored-by: devloai[bot] <168258904+devloai[bot]@users.noreply.github.com>
@jmcouffin jmcouffin added the Command Line Utility (CLI) Issues related to pyRevit CLI tool [subsystem] label Jan 24, 2025
@jmcouffin jmcouffin merged commit 6e801e6 into pyrevitlabs:develop Jan 24, 2025
@thumDer thumDer deleted the dev/cli-assembly-resolve branch January 24, 2025 15:16
@github-actions
Copy link
Copy Markdown
Contributor

📦 New work-in-progress (wip) builds are available for 5.0.0.25024+1520-wip

@github-actions
Copy link
Copy Markdown
Contributor

📦 New work-in-progress (wip) builds are available for 5.0.0.25024+1957-wip

@github-actions
Copy link
Copy Markdown
Contributor

📦 New work-in-progress (wip) builds are available for 5.0.0.25025+1310-wip

@github-actions
Copy link
Copy Markdown
Contributor

📦 New work-in-progress (wip) builds are available for 5.0.0.25030+1056-wip

@github-actions
Copy link
Copy Markdown
Contributor

📦 New work-in-progress (wip) builds are available for 5.0.0.25030+1130-wip

@github-actions
Copy link
Copy Markdown
Contributor

📦 New work-in-progress (wip) builds are available for 5.0.0.25030+1138-wip

@github-actions
Copy link
Copy Markdown
Contributor

📦 New work-in-progress (wip) builds are available for 5.0.0.25031+1700-wip

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Feb 1, 2025

📦 New work-in-progress (wip) builds are available for 5.0.0.25032+1615-wip

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Feb 1, 2025

📦 New work-in-progress (wip) builds are available for 5.0.0.25032+1635-wip

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Feb 1, 2025

📦 New work-in-progress (wip) builds are available for 5.0.0.25032+1841-wip

@thumDer
Copy link
Copy Markdown
Contributor Author

thumDer commented Feb 1, 2025

Just for the record: I had a similar issue with another addin and it turned out one of the other dependencies had a dependency on a specific version of a specific assembly that had trouble loading, so I might have a look on all the other dependencies, if this is the case here.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Feb 2, 2025

📦 New work-in-progress (wip) builds are available for 5.0.0.25033+1337-wip

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Feb 2, 2025

📦 New work-in-progress (wip) builds are available for 5.0.0.25033+1402-wip

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Feb 3, 2025

📦 New work-in-progress (wip) builds are available for 5.0.0.25034+1241-wip

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Feb 3, 2025

📦 New work-in-progress (wip) builds are available for 5.0.0.25034+1511-wip

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Feb 3, 2025

📦 New public release are available for 5.0.0.24174+2300

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Command Line Utility (CLI) Issues related to pyRevit CLI tool [subsystem]

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants