-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
Could not load file or assembly 'System.Diagnostics.DiagnosticSource, Version=5.0.0.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. #61445
Comments
I couldn't figure out the best area label to add to this issue. If you have write-permissions please help me learn by adding exactly one area label. |
Tagging subscribers to this area: @tarekgh, @tommcdon, @pjanotti Issue DetailsDescriptionI have a .net framework app using 4.7.2 - It is a web application using MVC. I do see this in the stack trace when I try to access the GET request in the controller of the web application. [FileLoadException: Could not load file or assembly 'System.Diagnostics.DiagnosticSource, Version=5.0.0.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)] Now, I am using but it is expecting 5.0.1. Isn't it backward compatible?Also, if I change this version to 5.0.1 --I see other package referencing failing in this case. "C:\ASM-AlertingMicroService\src\ASMFeedback\ASMFeedback.csproj" (Restore target) (1) -> Does this mean that the extensions.logging is dependant on this version 6.0.0..) which is why I am unable to restore the package? Reproduction Steps
and my file where I specify these versions is Expected behaviorShouldn't be seeing this error irrespective of the version, especially since I am using a higher version) Actual behaviorCould not load file or assembly 'System.Diagnostics.DiagnosticSource, Version=5.0.0.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. [FileLoadException: Could not load file or assembly 'System.Diagnostics.DiagnosticSource, Version=5.0.0.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)] [TypeInitializationException: The type initializer for 'OpenTelemetry.Sdk' threw an exception.] Regression?Yes, it worked in a .net framework build from the .csproj file that VS created. I now edited the .csproj file a bit to fit into my repo and use the common build settings and I am running to this error. Known WorkaroundsNo response Configurationrunning on x64, using .net 4.7.2. This is run on Windows. Other informationNo response
|
@ssarin3194 thanks for your report. If you can provide a sample project demonstrating the issue, that would be helpful to investigate. Meanwhile, could you try to change the package reference in your project to reference version 6.0 of <PackageReference Include="System.Diagnostics.DiagnosticSource" Version="6.0.0" /> And in <runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="System.Runtime.CompilerServices.Unsafe" publicKeyToken="B03F5F7F11D50A3A" culture="neutral"/>
<bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.0.0"/>
</dependentAssembly>
...
</assemblyBinding>
</runtime>
|
Hi, Also, when I update the package version to 6.0.0.0 i see the following error "Feedback.csproj" (Restore target) (1) -> Does this mean that I need to downgrade System.Runtime.CompilerServices.Unsafe also to 6.0.0? |
The issue was that the dll version 5.0.0.1 was not getting loaded since we hadn't mentioned the binding in web.config. This had to be updated as -- Another solution was to --- true needs to be set in the .csproj file which automatically takes care of redirects. |
Description
I have a .net framework app using 4.7.2 - It is a web application using MVC.
I do see this in the stack trace when I try to access the GET request in the controller of the web application.
[FileLoadException: Could not load file or assembly 'System.Diagnostics.DiagnosticSource, Version=5.0.0.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)]
OpenTelemetry.Sdk..cctor() +0
Now, I am using
but it is expecting 5.0.1. Isn't it backward compatible?Also, if I change this version to 5.0.1 --I see other package referencing failing in this case.
"C:\ASM-AlertingMicroService\src\ASMFeedback\ASMFeedback.csproj" (Restore target) (1) ->
(Restore target) ->
Feedback.csproj : error NU1605: Detected package downgrade: System.Diagnostics.DiagnosticSource from 6.0.0-rc.2.21480
.5 to 5.0.1. Reference the package directly from the project to select a different version.
Feedback.csproj : error NU1605: Microsoft.Asm.ASMFeedback -> Microsoft.Extensions.Logging 6.0.0-rc.2.21480.5 -> System
.Diagnostics.DiagnosticSource (>= 6.0.0-rc.2.21480.5)
Feedback.csproj : error NU1605: Microsoft.Asm.ASMFeedback -> System.Diagnostics.DiagnosticSource (>= 5.0.1)
Does this mean that the extensions.logging is dependant on this version 6.0.0..) which is why I am unable to restore the package?
Reproduction Steps
and my file where I specify these versions is
Expected behavior
Shouldn't be seeing this error irrespective of the version, especially since I am using a higher version)
Actual behavior
Could not load file or assembly 'System.Diagnostics.DiagnosticSource, Version=5.0.0.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference.
[FileLoadException: Could not load file or assembly 'System.Diagnostics.DiagnosticSource, Version=5.0.0.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)]
OpenTelemetry.Sdk..cctor() +0
[TypeInitializationException: The type initializer for 'OpenTelemetry.Sdk' threw an exception.]
OpenTelemetry.Sdk.get_SuppressInstrumentation() +0
OpenTelemetry.Logs.OpenTelemetryLoggerProvider..cctor() +15
System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() +32
Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitConstructor(ConstructorCallSite constructorCallSite, RuntimeResolverContext context) +407
Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSiteMain(ServiceCallSite callSite, TArgument argument) +274
Regression?
Yes, it worked in a .net framework build from the .csproj file that VS created. I now edited the .csproj file a bit to fit into my repo and use the common build settings as mentioned above and I am running to this error where the assembly is not getting loaded anymore.
Known Workarounds
No response
Configuration
dotnet --version
5.0.403
running on x64, using .net 4.7.2. This is run on Windows.
Other information
No response
The text was updated successfully, but these errors were encountered: