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

问题描述

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

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中的项目配置为Mono 谢谢您的每一个想法,谢谢!

解决方法

我认为您是说.NET Core 2吗?

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

PlatformNotSupportedException:不支持此操作 平台。

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

相关问答

错误1:Request method ‘DELETE‘ not supported 错误还原:...
错误1:启动docker镜像时报错:Error response from daemon:...
错误1:private field ‘xxx‘ is never assigned 按Alt...
报错如下,通过源不能下载,最后警告pip需升级版本 Requirem...