Microsoft.Hadoop.Avro is not supported for net8.0 project

Liangjun Hu 20 Reputation points Microsoft Employee
2025-02-13T10:28:26.7166667+00:00

I want to use AvroContainer.CreateGenericReader to read avro file after download it from azure blob storage. But Microsoft.Hadoop.Avro is not supported in net8 project as the following error. Any suggested pkg to read the avro file?
Package 'Microsoft.Hadoop.Avro 1.5.6' was restored using '.NETFramework,Version=v4.6.1, .NETFramework,Version=v4.6.2, .NETFramework,Version=v4.7, .NETFramework,Version=v4.7.1, .NETFramework,Version=v4.7.2, .NETFramework,Version=v4.8, .NETFramework,Version=v4.8.1' instead of the project target framework 'net8.0'. This package may not be fully compatible with your project.

Azure Blob Storage
Azure Blob Storage
An Azure service that stores unstructured data in the cloud as blobs.
3,082 questions
Azure Event Grid
Azure Event Grid
An Azure event routing service designed for high availability, consistent performance, and dynamic scale.
424 questions
0 comments No comments
{count} votes

Accepted answer
  1. Hari Babu Vattepally 1,720 Reputation points Microsoft Vendor
    2025-02-13T11:47:47.96+00:00

    Hi @Liangjun Hu ,

    I understand that you would like to use AvroContainer.CreateGenericReader to read avro file and it says that the Microsoft.Hadoop.Avro 1.5.6 is not compatible.

    We see that the Microsoft.Hadoop.Avro package has been depreciated as it is legacy and is no longer maintained. Which is now not compatible with the .Net 8.0 Framework, since it focuses on older versions of the .NET Framework.

    However, to read the Avro files in a .NET 8.0 project, you can use Confluent's Apache.Avro package and Chr.Avro both has its own specifications such as.

    Apache.Avro package is designed for compatibility with .NET Core and newer frameworks. It offers functionality for reading and writing Avro files and should be suitable for your project.

    Chr.Avro package is flexible, and it provides features like schema models, type resolution, and binary serialization.By using any of the above packages you would be able to read Avro files in your .NET project targeting Net8.0 without any compatibility issues.

    I hope this helps! Let me know if you have any further questions or if the issue still persists. We will be glad to assist you closely.

    Please do not forget to "Accept the answer” and “up-vote” wherever the information provided helps you, this can be beneficial to other community members. 

    1 person found this answer helpful.

1 additional answer

Sort by: Most helpful
  1. Sina Salam 17,571 Reputation points
    2025-02-13T16:40:42.34+00:00

    Hello Liangjun Hu,

    Welcome to the Microsoft Q&A and thank you for posting your questions here.

    I understand that you would like to know the alternative to Microsoft.Hadoop.Avro which is not supported for net8.0 project.

    Considering your Azure Blob Storage, Chr.Avro is a flexible and efficient library for working with Avro data in .NET applications. - https://www.c-sharpcorner.com/article/how-to-work-with-avro-data-type-in-net-environment . You can use it to serialize and deserialize Avro data, which can then be stored in or retrieved from Azure Blob Storage and to integrate Chr.Avro with Azure Blob Storage, you can follow these general steps:

    • Use Chr.Avro to serialize your data into Avro format.
    • Use the Azure Blob Storage SDK to upload the serialized Avro data to a blob.
    • Retrieve the Avro data from Azure Blob Storage.
    • Use Chr.Avro to deserialize the data back into your .NET objects.

    For better understanding in schema representation and type mapping - https://engineering.chrobinson.com/dotnet-avro/internals/implementation

    I hope this is helpful! Do not hesitate to let me know if you have any other questions.


    Please don't forget to close up the thread here by upvoting and accept it as an answer if it is helpful.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.