Unity3D 插件DLL生成问题
刚接触unity,尝试做个插件DLL库在unity下使用。
工具 Visual Studio 2019
语言C#
生成DLL后,unity中:
using DLLName
调用时部分接口正常,有些报错:
TypeLoadException: Could not resolve type with token 0100002c (from typeref, class/assembly System.Text.Encoding, System.Runtime, Version=4.2.2.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a)
原因:
.net core问题,生成dll时选用的.net core3.1框架,而查unity发现,不支持.net core

解决:
生成DLL时选择.net framework 4.x版本

博客讲述了作者在使用Unity3D时遇到的DLL加载问题,由于选择了.NET Core 3.1框架生成DLL,导致在Unity中出现TypeLoadException。经过调查发现Unity不支持.NET Core。解决方案是重新编译DLL,改为使用.NET Framework 4.x版本,从而成功解决兼容性问题。
2132

被折叠的 条评论
为什么被折叠?



