jeremytammik / RevitLookup

Interactive Revit RFA and RVT project database exploration tool to view and navigate BIM element parameters, properties and relationships.
http://thebuildingcoder.typepad.com
MIT License
1.03k stars 294 forks source link

latest release won't run #210

Closed russgreen closed 6 days ago

russgreen commented 2 months ago

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

Nice3point commented 2 months ago

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 commented 2 months ago

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 commented 2 months ago

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 commented 2 months ago

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 commented 2 months ago

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 commented 2 months ago

The issue is not related to the Serilog?

Nice3point commented 2 months ago

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 commented 2 months ago

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

chuongmep commented 2 months ago

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

Nice3point commented 2 months ago

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

ricaun commented 2 months ago

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 commented 2 months ago

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 commented 2 months ago

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 commented 2 months ago

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 commented 2 months ago

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 изображение

ricaun commented 1 month ago

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: https://github.com/jeremytammik/RevitLookup/issues/246

Nice3point commented 6 days ago

Solved in https://github.com/jeremytammik/RevitLookup/releases/tag/2025.0.8