如何在 Android / OculusGo 平台的 Unity 中修复“PlatformNotSupportedException:此平台不支持操作”

How to fix " PlatformNotSupportedException: Operation is not supported on this platform" in Unity for the Android / OculusGo platform

在我的应用程序中,我尝试连接到 OpcUa 服务器。在 Unity Editor 模式下,连接按预期工作,但是在为 Android 和 运行 应用程序构建时,我收到以下错误:

PlatformNotSupportedException: Operation is not supported on this platform.
08-13 19:10:13.635  8047  8071 E Unity   :   at Opc.Ua.Bindings.BufferManager..ctor (System.String name, System.Int32 maxPoolSize, System.Int32 maxBufferSize) [0x0001a] in <47abe48abf58405785b9c72f0d4f7649>:0
08-13 19:10:13.635  8047  8071 E Unity   :   at Opc.Ua.Bindings.UaSCUaBinaryTransportChannel.SaveSettings (System.Uri url, Opc.Ua.TransportChannelSettings settings) [0x001a6] in <47abe48abf58405785b9c72f0d4f7649>:0
08-13 19:10:13.635  8047  8071 E Unity   :   at Opc.Ua.Bindings.UaSCUaBinaryTransportChannel.Initialize (System.Uri url, Opc.Ua.TransportChannelSettings settings) [0x00001] in <47abe48abf58405785b9c72f0d4f7649>:0
08-13 19:10:13.635  8047  8071 E Unity   :   at Opc.Ua.WcfChannelBase.CreateUaBinaryChannel (Opc.Ua.ApplicationConfiguration configuration, Opc.Ua.EndpointDescription description, Opc.Ua.EndpointConfiguration endpointConfiguration, System.Security.Cryptography.X509Certificates.X509Certificate2 clientCertificate, System.Security.Cryptography.X509Certificates.X509Certificate2Collection clientCertificateChain, Opc.Ua.ServiceMessageContext messageContext) [0x00156] in <47abe48ab

我认为是由以下行触发的:

endpointDescription = CoreClientUtils.SelectEndpoint(endpointURL, UseSecurity, ConnectTimeout);

不幸的是,我在解决方案资源管理器中找不到任何包含“UaSCUaBinaryTransportChannel”、“maxpoolsize”或错误中包含的其他关键字的文件,所以我不知道如何调试它...

项目配置是 .NET Core 2 的单声道 我将非常感谢您的每一个想法,谢谢!

我想你是说 .NET Core 2?

在这种情况下,BufferManager class 不可用。

PlatformNotSupportedException: Operation is not supported on this platform.

来源:https://docs.microsoft.com/en-us/dotnet/api/system.servicemodel.channels.buffermanager?view=dotnet-plat-ext-3.1&viewFallbackFrom=netcore-2.0