Skip to content

Azure.Monitor: fix for Microsoft.Bcl.AsyncInterfaces#42426

Merged
TimothyMothra merged 10 commits intomainfrom
tilee/fix_bcl
Mar 7, 2024
Merged

Azure.Monitor: fix for Microsoft.Bcl.AsyncInterfaces#42426
TimothyMothra merged 10 commits intomainfrom
tilee/fix_bcl

Conversation

@TimothyMothra
Copy link
Copy Markdown

@TimothyMothra TimothyMothra commented Mar 5, 2024

Fixes #42360, #41747

This PR is a fix for a runtime crash.

System.Reflection.ReflectionTypeLoadException
  HResult=0x80131602
  Message=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.

This is related to projects referencing either Distro or LiveMetrics, which references netstandard2.0 and Exporter which references net6. Runtime looks for a newer version of Microsoft.Bcl.AsyncInterfaces and crashes.

Changes

  • add net6 to Azure.Monitor.OpenTelemetry.AspNetCore and Azure.Monitor.OpenTelemetry.LiveMetrics.
    This brings both projects in sync with Azure.Monitor.OpenTelemetry.Exporter.
  • fix some nullable compile issues in both AspNetCore and LiveMetrics projects discovered by the newer framework.
  • Remove Microsoft.Bcl.AsyncInterfaces from our Test and Demo projects.

@github-actions github-actions bot added Monitor - Distro Monitor OpenTelemetry Distro Monitor - LiveMetrics labels Mar 5, 2024
@azure-sdk
Copy link
Copy Markdown
Collaborator

API change check

API changes are not detected in this pull request.

@TimothyMothra TimothyMothra marked this pull request as ready for review March 6, 2024 01:00
@TimothyMothra TimothyMothra enabled auto-merge (squash) March 7, 2024 22:36
@TimothyMothra TimothyMothra merged commit 6a5d0e2 into main Mar 7, 2024
@TimothyMothra TimothyMothra deleted the tilee/fix_bcl branch March 7, 2024 22:37
angiurgiu pushed a commit that referenced this pull request Mar 20, 2024
* add net6 to AspNetCore and LiveMetrics

* fix compiler issues

* test removing bcl fix from test/demo projects

* fix compiler issues in LiveMetrics

* changelog

* re-enable nullable in Filter classes

* update error message

* revert
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Monitor - Distro Monitor OpenTelemetry Distro Monitor - LiveMetrics

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEATURE REQ] Azure.Monitor.OpenTelemetry - synchronize TargetFramework across packages

4 participants