Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

latest release won't run #210

Open
russgreen opened this issue Apr 2, 2024 · 16 comments
Open

latest release won't run #210

russgreen opened this issue Apr 2, 2024 · 16 comments
Labels
bug 🐛 An unexpected issue that highlights incorrect behavior wontfix ❌ An abandoned issue or PR that won't get fixed

Comments

@russgreen
Copy link

I'm getting a missing method exception on the latest build https://github.com/jeremytammik/RevitLookup/releases/tag/2025.0.0
image

@Nice3point
Copy link
Collaborator

Nice3point commented Apr 2, 2024

you have installed plugins using the Microsoft.Extensions.Options.dll ? microsoft updated it recently, and it became incompatible with earlier versions. RevitLookup used the latest

the easiest way is to copy this library from RevitLookup to another plugin that depends on it. or if this is your plugin, update the version to 8.0.2.

is there a problem with RevitLookup 2024 and older?

@russgreen
Copy link
Author

Yes, that'll be it. I'm using Microsoft.Extensions.Hosting v7. If you have to use v7 in 2025 is there a benefit in using v8 in earlier Revit versions?

@Nice3point
Copy link
Collaborator

In older versions I keep 8.0 to ensure compatibility with existing plugins, and its the latest stable version with a lot of optimizations. Autodesk didn't have time to update the dependency to the latest version in revit 25, they promised to fix it in the next patch/hotfix

@Nice3point
Copy link
Collaborator

Nice3point commented Apr 3, 2024

You can support different versions like this. &lt; its a < symbol in xml

<PackageReference Include="Microsoft.Extensions.Hosting" Version="7.*" Condition="$(RevitVersion) == '2025'"/>
<PackageReference Include="Microsoft.Extensions.Hosting" Version="8.*" Condition="$(RevitVersion) != '' And $(RevitVersion) &lt; '2025'"/>

Maybe it's a temporary measure until the hotfix comes out

@russgreen
Copy link
Author

Maybe. There's other important 3rd party plugins I use that currently depend on hosting v7. I'll have to see how that works its way through.

@ricaun
Copy link
Contributor

ricaun commented Apr 3, 2024

The issue is not related to the Serilog?

@Nice3point
Copy link
Collaborator

Nope, the problem is with the microsoft dependency bundle. The fact that the exception occurs with Serilog is just a coincidence that it is the first to call conflicting methods. But RevitLookup has been using version 8 dependencies for a long time, since the release of .Net 8. I had to downgrade to version 7 just for Revit 2025 to avoid conflicts. 2024 and older still use 8

@Nice3point
Copy link
Collaborator

I'm always in favour of keeping dependency versions up to date, and not using outdated ones

@chuongmep
Copy link
Contributor

@Nice3point I hear that .NET 8 easier to resolve assembly conflict

@Nice3point
Copy link
Collaborator

@chuongmep yeh, net 8 has AssemblyLoadContext, and dependency resolving works completely differently there compared to the .net framework

@ricaun
Copy link
Contributor

ricaun commented Apr 4, 2024

Nope, the problem is with the microsoft dependency bundle. The fact that the exception occurs with Serilog is just a coincidence that it is the first to call conflicting methods. But RevitLookup has been using version 8 dependencies for a long time, since the release of .Net 8. I had to downgrade to version 7 just for Revit 2025 to avoid conflicts. 2024 and older still use 8

Looks like the interface ILoggingBuilder changed between versions, just wondered the reason that the logger was updated to use Serilog.

I'm always in favour of keeping dependency versions up to date, and not using outdated ones

Me too, but inside Revit the rules change. Especially if Revit decides to use the same library with an old version. That's the main reason I usually avoid to use well know libraries inside Revit, to make sure the plugin gonna run without any conflict with Revit or other plugins.

@Nice3point
Copy link
Collaborator

Nice3point commented Apr 4, 2024

Especially if Revit decides to use the same library with an old version.

I agree, that's why I first look to see if the library bundled in Revit. If so, I use Condition to set a fixed version.
I have done the same with Microsoft.Extension.DependencyInjection in RevitLookup and set exactly the version that bundled in Revit 2025

@russgreen
Copy link
Author

russgreen commented Apr 4, 2024

so just to clarify.....if update Microsoft.Extension.DependencyInjection in any addins I have control over to 8., in Revit 2024 and earlier, will that prevent me from using them alongside any other addins that use Microsoft.Extension.DependencyInjection 7.?

@Nice3point
Copy link
Collaborator

Not sure, if they only use Microsoft.Extension.DependencyInjection then maybe everything will work. But if Hosting, I can't give any guarantees. I still recommend you to update your projects to the current version 8

@Nice3point
Copy link
Collaborator

The version before 2025 is not restricted, it's just an agreement between developers to use the latest versions. But from 2025 onwards we need to use the one that ships with Revit
изображение

@Nice3point Nice3point added bug 🐛 An unexpected issue that highlights incorrect behavior wontfix ❌ An abandoned issue or PR that won't get fixed labels Apr 30, 2024
@ricaun
Copy link
Contributor

ricaun commented May 26, 2024

I found a way!

RevitLookup - DI 8 0 0
Is not pretty and I have a strange problem with the build automation that is breaking something, the SetVersion is messing with the output and dll generated with the build does not work when I have multiple versions.

Here is the issue for that problem: #246

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐛 An unexpected issue that highlights incorrect behavior wontfix ❌ An abandoned issue or PR that won't get fixed
Projects
None yet
Development

No branches or pull requests

4 participants