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

.NET Framework 4.8 Class Library compatibility issue with Azure.Storage.Blob package #93177

Closed
RitaAguiar opened this issue Oct 7, 2023 · 4 comments
Labels
needs-area-label An area label is needed to ensure this gets routed to the appropriate area owners question Answer questions and provide assistance, not an issue with source code or documentation. tracking-external-issue The issue is caused by external problem (e.g. OS) - nothing we can do to fix it directly

Comments

@RitaAguiar
Copy link

RitaAguiar commented Oct 7, 2023

Description

I have built a .NET Framework 4.8 Class Library project to run on top of Autodesk Revit (building information modeling tool).
I added only 3 packages:

  • Azure.Storage.Blob 12.18.0
  • Revit.RevitApi.x64 2023.0.0
  • Revit.RevitApiUI.x64 2023.0.0

I want to be able to list files from a storage account container. However, there seems to be some incompatibilities between .NET Framework 4.8 Class Library and the Azure.Storage.Blob package.

Reproduction Steps

Pls refer to the test-azure-revitapi repo where I made a minimal .NET Framework 4.8 Class Library project. You need Autodesk Revit 2023 to run this plugin.

Expected behavior

The expected behavior is to be able to initialize an instance of BlobServiceClient class (Azure.Storage.Blob).

Actual behavior

In the minimal project, this is the error obtained:

System.Reflection.TargetInvocationException: 'Exception has been thrown by the target of an invocation.'
Inner Exception
FileNotFoundException: Could not load file or assembly 'Azure.Storage.Blobs, Version=12.18.0.0, Culture=neutral, PublicKeyToken=92742159e12e44c8' or one of its dependencies. The system cannot find the file specified.

The project that I'm working on and that I cannot share here has the same 3 packages plus many others. The error I get is:

System.TypeInitializationException: 'The type initializer for 'Azure.Core.Pipeline.DiagnosticScopeFactory' threw an exception.'
Inner Exception
TypeLoadException: Could not load type 'System.Diagnostics.ActivitySource' from assembly 'System.Diagnostics.DiagnosticSource, Version=4.0.1.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'.

Regression?

I have not found a previous release where this works. However, I built a minimal project with .NET Framework 4.8 Console App with the same packages that works as expected.

Known Workarounds

No workarounds I have found.
However, I built a minimal project with both a .NET Framework 4.8 Class Library and a .NET Framework 4.8 Console App.
The .NET Framework 4.8 Class Library project results in the problem mentioned above.
The .NET Framework 4.8 Console App project with the same packages works as expected.
Upgrading the project to .NET 5 or .NET 6 is not really an option given that the RevitAPI might not behave as expected.

Configuration

.NET Framework 4.8 Class Library
Windows 11
Any CPU

Other information

I believe there must be some package using the System.Diagnostics.DiagnosticSource, it could potentially be the Revit API packages, however, I built a Console App that includes those packages despite not being in use, and it behaves as expected, this is, I'm able to list the files in the container. Azure Storage Blob package seems to use the System.Diagnostics.DiagnosticSource version 7.0.2.0. However, the error I'm getting on the main project I'm working on is that is it looking for the System.Diagnostics.DiagnosticSource version 4.0.1.0.

@dotnet-issue-labeler dotnet-issue-labeler bot added the needs-area-label An area label is needed to ensure this gets routed to the appropriate area owners label Oct 7, 2023
@ghost ghost added the untriaged New issue has not been triaged by the area owner label Oct 7, 2023
@teo-tsirpanis teo-tsirpanis added the question Answer questions and provide assistance, not an issue with source code or documentation. label Oct 7, 2023
@jeffschwMSFT
Copy link
Member

@RitaAguiar Visual Studio developer community is the best place for .NET Framework questions.

https://developercommunity.visualstudio.com/home

Once you have filed feedback there, please post it back here to connect them. I can help route to the appropriate team.

@jkotas jkotas added the tracking-external-issue The issue is caused by external problem (e.g. OS) - nothing we can do to fix it directly label Oct 10, 2023
@jeffschwMSFT
Copy link
Member

once a VS developer community issue has been filed, please let us know

@ghost ghost removed the untriaged New issue has not been triaged by the area owner label Oct 19, 2023
@nicolaslcalvi
Copy link

Same problem an I found a workaround for that, tested on Revit 2024 Api.
Install the version 12.17.0 of Azure.Storage.Blobs from Nuget and don't update anything !

@m-redding
Copy link

@RitaAguiar there's a discussion about this in the azure-sdk-for-net repo in this issue: Azure/azure-sdk-for-net#39798

@github-actions github-actions bot locked and limited conversation to collaborators Dec 15, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
needs-area-label An area label is needed to ensure this gets routed to the appropriate area owners question Answer questions and provide assistance, not an issue with source code or documentation. tracking-external-issue The issue is caused by external problem (e.g. OS) - nothing we can do to fix it directly
Projects
None yet
Development

No branches or pull requests

6 participants