jeremytammik/RevitLookup

latest release won't run

Closed this issue · 17 comments

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

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?

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?

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

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

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.

The issue is not related to the Serilog?

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

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

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

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

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.

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

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.?

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

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

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