Native plugin .net 8 onnxgenAI multimodal

hi does unity support .net 8? I was trying to load a native library that build against .net8 and the standard 2.1 API .

idk what the roadmad means by “internal coreclr player” is it in runtime after pressing the play button and / or after build ?

the manged part of the library I’m using loaded just fine microsoft.ml.onnxgenAI however , the native plugin is probably has some issues :

after building I found the native library but it doesn’t load up .. are there any clue how to debug this or if I can’t at all atm ?

While not technically an answer to your question, Unity Sentis can load (and optimize) ONNX models on all platforms

Thanks I know that , but I’m using the GenAI extensions , which support localGenAI api ( no server ) not relying on unity api either .

I was able to load and run microsoft model phi3 with no problem at all .
I want to do the same thing for multiimodal one which is the 4 version . however it seems that I need to upgrade to the new runtime with new APIs ..

I understand that Sentis can uses onnx models but I was trying to acess the API of new onnx runtime .

Unity currently supports up to C# 8, along with a limited subset of C# 9 features. The supported runtime is the .NET Framework, the modern .NET (Core/.NET 5+) runtime is not yet supported. Unity - Manual: C# compiler and language version reference

This will remain the case until Unity transitions to CoreCLR, which is expected at Unity 6.8, but for production use, the first LTS release following 6.8 will likely be the practical target.

I guess the only hacky way is to use maui as the main thread then load .net as a library with Ibridge interface , thanks

It can only be built against one or the other. If it does support .NET Standard 2.1 it should work in Unity. In Project Settings / Player check that .NET Standard 2.x is selected rather than .NET Framework 4.x.

Note that this “native library” may still not work within the context of Unity. It may rely on .NET features wich Unity’s Mono implementation doesn’t support. But more importantly it depends on what “native” really means here. If for instance this library wants to use an OpenGL or DirectX context it might be in direct resource conflict since Unity also uses graphics APIs.