当前位置:网站首页>ExecutionEngineException: String conversion error: Illegal byte sequence encounted in the input.
ExecutionEngineException: String conversion error: Illegal byte sequence encounted in the input.
2022-08-08 06:26:00 【GREAT1217】
我是在Unity 2019.4.10中调用.dll文件中的函数传递string参数时出现的这个错误。
ExecutionEngineException: String conversion error: Illegal byte sequence encounted in the input.
引擎执行异常:字符串转换错误:在输入中遇到非法的字节序列。
在网上搜索到了两种解决方式如下:
解决方案一:
删除项目中的 .js 脚本。
原因:Unity 2017.2测试版的Create Assets菜单下已经不再包含Javascript(即UnityScript)选项,建议使用C#脚本重新实现逻辑。
解决方案二:
将计算机名称、应用程序的名称、脚本路径修改为单字节字符(英文)。
原因:有些编码不支持双字节字符。
但是这两种方式没有解决我的问题,于是经过我半天的摸索,找到了问题的原因:
dll文件源代码和Unity使用的.NetFramework版本不一致。
Unity 2019.4.10默认使用的.Net 4,所以我使用Unity 2018.2.1进行了测试,如下图,切换回.Net 3.5 Equivalent 就没有问题了。
至于Unity 2019.4.10,官方文档显示如下图:.Net 3.5已弃用。
可以考虑修改dll文件源代码的.NetFramework版本。
边栏推荐
猜你喜欢
随机推荐
如何使用conda,pip安装、更新、查看和卸载重装Pytorch?
略解损失函数
[Unity] GPU动画实现(一)——介绍
线程P01——进程 并发 并行 线程的使用
正则爬取豆瓣Top250数据存储到CSV文件(6行代码)
firefly rk3399 硬件解码,多通道解码
【图形学】16 光照模型(一、理论与公式)
Unity HDRP中代码动态修改天空盒以及其他环境参数
NVIDIA CUDA Highly Parallel Processor Programming (8): Parallel Mode: Histogram Calculation
[GWCTF 2019] I have a database 1
TPLinker: Single-stage Joint Extraction of Entities and Relations Through Token Pair Linking
DesignWare_APB_GPIO模块DUT&Testbench仿真
虚拟机克隆 快照 迁移 删除
MongoDB中的聚合-管道
Industry Research: Analysis of the Status and Prospects of the Pension Insurance Market in 2022
线性回归---Fit A Line
P03 线程安全 synchronized Lock
acwing 第63场周赛【2022.08.06】
神经网络预测结果分析,神经网络怎么预测数据
fpga卷积神经网络加速器,FPGA卷积神经网络综述










