У меня есть соединение SignalR, работающее в редакторе Unity3D и автономной сборке Windows, но когда я выполняю сборку WebGL, при подключении к концентратору я получаю следующую ошибку.
ArgumentNullException: значение не может бытьноль.Имя параметра: формат в System.String.FormatHelper (поставщик System.IFormatProvider, формат System.String, аргументы System.ParamsArray)
Я не смог найти ответ, почему это такпроисходит только с WebGL, и я даже не уверен, так ли это, потому что это WebGL или что-то связанное с Unity.
Кто-нибудь еще сталкивался с этим и знает, почему он только генерируется при сборке WebGL.
Редактировать: Добавление трассировки из исключения
ArgumentNullException: Value cannot be null. Parameter name: format
at System.String.FormatHelper (System.IFormatProvider provider, System.String format, System.ParamsArray args) [0x00000] in <00000000000000000000000000000000>:0
at System.String.Format (System.IFormatProvider provider, System.String format, System.Object arg0) [0x00000] in <00000000000000000000000000000000>:0
at Microsoft.Extensions.DependencyInjection.Resources.FormatNoConstructorMatch (System.Object p0) [0x00000] in <00000000000000000000000000000000>:0
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteFactory.CreateConstructorCallSite (System.Type serviceType, System.Type implementationType, Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteChain callSiteChain) [0x00000] in <00000000000000000000000000000000>:0
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteFactory.TryCreateExact (Microsoft.Extensions.DependencyInjection.ServiceDescriptor descriptor, System.Type serviceType, Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteChain callSiteChain) [0x00000] in <00000000000000000000000000000000>:0
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteFactory.TryCreateExact (System.Type serviceType, Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteChain callSiteChain) [0x00000] in <00000000000000000000000000000000>:0
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteFactory.CreateCallSite (System.Type serviceType, Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteChain callSiteChain) [0x00000] in <00000000000000000000000000000000>:0
at Microsoft.Extensions.DependencyInjection.ServiceLookup.ServiceProviderEngine.CreateServiceAccessor (System.Type serviceType) [0x00000] in <00000000000000000000000000000000>:0
at System.Func`2[T,TResult].Invoke (T arg) [0x00000] in <00000000000000000000000000000000>:0
at System.Collections.Concurrent.ConcurrentDictionary`2[TKey,TValue].GetOrAdd (TKey key, System.Func`2[T,TResult] valueFactory) [0x00000] in <00000000000000000000000000000000>:0
at Microsoft.Extensions.DependencyInjection.ServiceLookup.ServiceProviderEngine.GetService (System.Type serviceType, Microsoft.Extensions.DependencyInjection.ServiceLookup.ServiceProviderEngineScope serviceProviderEngineScope) [0x00000] in <00000000000000000000000000000000>:0
at Microsoft.Extensions.DependencyInjection.ServiceLookup.ServiceProviderEngine.GetService (System.Type serviceType) [0x00000] in <00000000000000000000000000000000>:0
at Microsoft.Extensions.DependencyInjection.ServiceProvider.GetService (System.Type serviceType) [0x00000] in <00000000000000000000000000000000>:0
at Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetService[T] (System.IServiceProvider provider) [0x00000] in <00000000000000000000000000000000>:0
at Microsoft.AspNetCore.SignalR.Client.HubConnectionBuilder.Build () [0x00000] in <00000000000000000000000000000000>:0
at PlayerConnection..ctor (System.String hubUrl, System.String access_token) [0x00000] in <00000000000000000000000000000000>:0
at ConnectionManager.Init (System.String access_token) [0x00000] in <00000000000000000000000000000000>:0
at SetupManager+<ConnectToHubs>d__5.MoveNext () [0x00000] in <00000000000000000000000000000000>:0
at UnityEngine.SetupCoroutine.InvokeMoveNext (System.Collections.IEnumerator enumerator, System.IntPtr returnValueAddress) [0x00000] in <00000000000000000000000000000000>:0
at UnityEngine.MonoBehaviour.StartCoroutineManaged2 (System.Collections.IEnumerator enumerator) [0x00000] in <00000000000000000000000000000000>:0
at UnityEngine.MonoBehaviour.StartCoroutine (System.Collections.IEnumerator routine) [0x00000] in <00000000000000000000000000000000>:0
at SetupManager+<WaitForAccessToken>d__4.MoveNext () [0x00000] in <00000000000000000000000000000000>:0
at UnityEngine.SetupCoroutine.InvokeMoveNext (System.Collections.IEnumerator enumerator, System.IntPtr returnValueAddress) [0x00000] in <00000000000000000000000000000000>:0 UnityEngine.MonoBehaviour:StartCoroutineManaged2(IEnumerator) UnityEngine.MonoBehaviour:StartCoroutine(IEnumerator) <WaitForAccessToken>d__4:MoveNext() UnityEngine.SetupCoroutine:InvokeMoveNext(IEnumerator, IntPtr)
(Filename: currently not available on il2cpp Line: -1)
Я могуотладьте hubUrl и access_token и распечатайте в отладке их значения, так что я знаю, что это не их причина.