I'm attempting to implement monitoring in my .NET 8 Web API Microservice by following the guidelines provided in this Microsoft Azure documentation https://learn.microsoft.com/en-us/azure/azure-monitor/app/opentelemetry-enable?tabs=aspnetcore . However, when running the application in my local development environment, I encounter the following error:
Unhandled exception
System.Reflection.ReflectionTypeLoadException: Unable to load one or more of the requested types.
Could not load file or assembly 'Microsoft.Bcl.AsyncInterfaces, Version=8.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'. The system cannot find the file specified.
I have ensured that I've followed the steps outlined in the documentation accurately, but I'm still facing this issue. How can I resolve this error and successfully implement monitoring in my application?
Additional Details:
.NET version: 8.0 Development environment: Local machine Relevant code snippets or configuration settings can be provided upon request.
Installation of Microsoft.Bcl.AsyncInterfaces 8.0.0.0 library from nuget package will ressolve the issue.
Regards Vijay