-
Notifications
You must be signed in to change notification settings - Fork 93
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
Version mismatch: Could not load file or assembly 'Microsoft.Extensions.DependencyInjection.Abstractions' #3075
Comments
@lorenzoiuri, I didn't have chance to start working on reproducing the issue. It will be great if you can create Minimal, Reproducible Example. It should not use your production code, but it should reproduce this in the mocked environment/scenario. |
@lorenzoiuri, I have created simple test application in Kielek@5ca51f1 Then executed build pipeline: https://github.com/Kielek/opentelemetry-dotnet-instrumentation/actions/runs/6824988834/job/18562149179 including Alpine. All tests passed. Is there any chance that you create steps to reproduce as described in my previous message? |
Hi @Kielek, thank you for your support. We are working on the minimal example: it's not so easy because the code has many submodules, each importing nuget libraries. |
Just to inform al those following this issue that I shared the minimal example with Kielek. |
@lorenzoiuri, please check the response in email. Please let me know if you are fine also to put shared code here, publicly. |
Hi Kielek, I received the reply and I'm trying to replicate your setup with instrument.sh. I'll let you known when we can publish the code. Thank you. |
Same issue here. Where the project, or dependant projects, have direct dependencies on Microsoft.Extensions.* 6.0, we are having I am not familiar on how the injection mechanism work, but why a net6 project should hard reference Microsoft.Extensions 7.* packages? |
The The The NuGet package, OpenTelemetry.AutoInstrumentation, is not intended to be used in conjunction with the AdditionalDeps and shared store. When using the NuGet package you should not have the DOTNET_ADDITIONAL_DEPS and DOTNET_SHARED_STORE configured and just use the instrument script to launch the application. In other words when using the NuGet package at build time, do not use the k8s operator to setup the instrumentation. One step that needs care when using the NuGet package is that the app should be build against the runtime that it is going to be running, e.g.: if you are going to run in Alpine but you are building on something else use a command like After all that said the usability for someone hitting this issue is not good. 🤔 We have to consider something less cumbersome path to get this working. |
@federicobarera, could you please create Minimal, Reproducible Example? It should include all steps you are using to build the package. In the private channel, after a lot of attempts, we ware able to find the root cause of the issue described by @lorenzoiuri - including tests projects with dependencies to the folder with application. |
@federicobarera, I have started new issue for you #3168. Please put all details there. I have received confirmation from @lorenzoiuri that the issue was related to the test dependencies. I am closing this issue. |
Hi, I just want to add that @Kielek suggested us to replace the commands:
with (example)
That solved the issue. |
Nice finding @Kielek! The generated deps.json doesn't hint at that because it shows a chain of dependencies reaching the affected dlls. .NET 8 provides a warning for this type of publish:
Thanks @lorenzoiuri for providing the detailed repro. |
Bug Report
Symptom
Describe the bug
Instrumented pod crashes with error (note
Version=6.0.0.0
andVersion=3.1.0.0
)Expected behavior
The pod should not crash.
Screenshots
If applicable, add screenshots to help explain your problem.
Runtime environment (please complete the following information):
Additional context
We include the following dependencies in multiple subprojects
We don't understand where the
Version=3.1.0.0
is coming from: we include version6.0.0
ofMicrosoft.Extensions.Hosting
which is the only one which depends onMicrosoft.Extensions.DependencyInjection.Abstractions
, while the dotnet instrumentator depends on version 7.0.0: https://github.com/open-telemetry/opentelemetry-dotnet-instrumentation/blob/main/src/Directory.Packages.props#L70.We tried upgrading
Microsoft.Extensions.Hosting
from6.0.0
to7.0.0
, with no changes.We also tried including the OpenTelemetry.AutoInstrumentation NuGet packages, as described in the troubleshooting but the problem persists.
Edit: We are using the dotnet instrumentation via the opentelementry kubernetes operator.
Reproduce
Unfortunately we cannot provide the source code.
The text was updated successfully, but these errors were encountered: