ML NET incompatible with Class Library that targets at .NET Framework and .NET Standard

焘 石 5 Reputation points
2023-04-18T09:07:32.4433333+00:00

I am trying to add ML model into my project that targets at NET framework 4.8.1. But after I added the trained model using ML.NET. I could not at all consume the model. The model class was in the same namespace, but I could not call the class. Then I switched to NET 2.0 standard. The class can be consumed, but after I built DLL, and tried to use it, it keeps giving "System.FormatException: One of the identified items was in an invalid format.". I tried VS 2019, VS 2022. For the class library output type, ML NET only worked on NET Core. But it needs to load System.Runtime version 6.0. This is not compatible with my project.

.NET Machine learning
.NET Machine learning
.NET: Microsoft Technologies based on the .NET software framework.Machine learning: A type of artificial intelligence focused on enabling computers to use observed data to evolve new behaviors that have not been explicitly programmed.
150 questions
{count} votes