- Home /
Can one use a .NET library in a WebGL build?
Hello,
I am using a 3D file format conversion library (Aspose.3d) to convert Unity scene objects to various formats and provide them to the user. Aspose.3D is a .net compatible library written in C#. When building my application to WebGL, I am getting internal IL2CPP errors when trying to use the library to build a basic scene.
Can anyone easily spot whether this is doable or not? Checking Aspose.3D supported platforms (https://docs.aspose.com/3d/net/system-requirements/#supported-operating-system) says that it should be compatible with anything that can use .NET core.
Thanks
Answer by JoshPeterson · Nov 19, 2020 at 11:55 AM
Unity does not support C# libraries built against .NET Core (on any platform, not just WebGL). If that library has a version that is built against .NET Standard 2.0 or .NET FW, then it should work. Looking at the link you provided, I think that if does have the proper versions.
With that said, WebGL is a pretty restrictive platform, so some API calls into the .NET Base Class Libraries that the code makes might not work. For example, WebGL does not have support for threads.
After looking more into it, I have realized that Aspose is using System.Threading in its scripts. So it's a no-go unfortunately. What's interesting is that the webgl build fails because of an IL2CPP error about weak references. So there's more barriers to solve.
Your answer
Follow this Question
Related Questions
System.Type.GetType() doesn't work on WEBGL 1 Answer
Can't build WebGL because of IL2CPP crash 4 Answers
Error occurs while building for WebGL 0 Answers
WebGL + Sqlite3 1 Answer