简体   繁体   English

Hololens中的DLL冲突与IL2CPP后端

[英]DLL conflict in Hololens with IL2CPP backend

I have been developing on the Hololens. 我一直在开发Hololens。 The project is on .NET 4.x with IL2CPP with API compatibility 4.x. 该项目在.NET 4.x上,IL2CPP与API兼容性4.x. I'm using Unity 2018.3.6f. 我正在使用Unity 2018.3.6f。

I need to add external DLL (IdentityClient.dll) 我需要添加外部DLL(IdentityClient.dll)

Reference: IdentityModel NuGet Package 参考: IdentityModel NuGet包

This dll has dependencies on both Newtonsoft.Json and System.Text.Encodings.Web. 这个DLL依赖于Newtonsoft.Json和System.Text.Encodings.Web。

After lot of work, I'm now able to deploy my application with the dlls, but when I use them, it makes my application crash. 经过大量的工作,我现在能够使用dll部署我的应用程序,但是当我使用它们时,它会使我的应用程序崩溃。 The problem is with Newtonsoft.Json. 问题出在Newtonsoft.Json上。

Since IL2CPP use AOT compilation and newtonsoft use reflection, it crashes. 由于IL2CPP使用AOT编译和newtonsoft使用反射,它崩溃了。 I've replaced the Newtonsoft.Json.dll with this https://assetstore.unity.com/packages/tools/input-management/json-net-for-unity-11347 我用这个https://assetstore.unity.com/packages/tools/input-management/json-net-for-unity-11347替换了Newtonsoft.Json.dll

I've been able to use Newtonsoft in my code, but the IdentityModel.dll still references the old implementation even though I deleted it. 我已经能够在我的代码中使用Newtonsoft,但即使我删除它,IdentityModel.dll仍然引用旧的实现。 So it crashes again. 所以它再次崩溃。 I'm kind of stuck right now and I'm wondering if any of you would has a solution! 我现在有点卡住了,我想知道你们中是否有人会有解决方案!

I'm also thinking if I can't fix it too : 我也在考虑是否也无法修复它:

  1. Fork the github project of IdentityModel and adjust it 分叉IdentityModel的github项目并进行调整
  2. Just make everything manually instead of relaying on IdentityModel, but it will probably take some time. 只需手动编写所有内容而不是在IdentityModel上进行中继,但这可能需要一些时间。

Moreover, everything works fine in the Unity Editor, but when it's deployed it crash. 此外,Unity编辑器中的一切工作正常,但是当它部署时会崩溃。

In the end, I decided to implement de dll myself. 最后,我决定自己实现de dll。 Most people working on Hololens seems to have similar issues 大多数致Hololens的人似乎都有类似的问题

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM