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

Add application insights to host logger #8

Closed
AmeerMansour opened this issue Aug 9, 2024 · 8 comments
Closed

Add application insights to host logger #8

AmeerMansour opened this issue Aug 9, 2024 · 8 comments

Comments

@AmeerMansour
Copy link

I am trying to add application insights to the host and I get this error not sure what is the issue

image
I just added Microsoft.Extensions.Logging.ApplicationInsights package and trying to use it
image

@AmeerMansour
Copy link
Author

I found the issue that revit uses an older version but shouldn't the assembly resolver handle that?
Microsoft.Extensions.Logging
these are the modules that loaded in the environment
image

@Nice3point
Copy link
Owner

What version of Revit are you using, 2025 or older?

@AmeerMansour
Copy link
Author

2024

@Nice3point
Copy link
Owner

Nice3point commented Aug 9, 2024

@AmeerMansour the problem and solutions are described here jeremytammik/RevitLookup#269
you have a plugin with outdated dependencies
check the installed plugins to understand which one uses Serilog.dll

@AmeerMansour
Copy link
Author

AmeerMansour commented Aug 11, 2024

the problem is not in 3rd party the problem is revit itself uses
C:\Program Files\Autodesk\Revit 2024\Microsoft.Extensions.Logging.dll version 2.02.0.18315 which doesn't have application insights extension !
so I have to downgrade my Microsoft.Extensions.Logging to the same version .

@AmeerMansour
Copy link
Author

if you have revit 2025 installed can you check if they are using Microsoft.Extensions.Logging version 2.02.0.18315 as well ?
as they are using it since 2020

@Nice3point
Copy link
Owner

Nice3point commented Aug 11, 2024

Yes, indeed older versions of Revit include version 2.2. You can downgrade the Nuget package version for them. The 2025 version includes version 7, but it doesn't matter because the 2025 version has enabled dependency isolation in the Toolkit and you can use Microsoft.Extensions.Logging version 8 with no problem.

@AmeerMansour
Copy link
Author

thanks !
it is really awful to be forced to use Microsoft.Extensions.Hosting v2 for older revit versions.
you may close this issue if you want

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants