NuGet更新,现在抛出OpenTok:System.IO.FileLoadException:无法在CreateSession上加载文件或程序集JWT Version = 2.0.0.0

问题描述 投票:0回答:1

我刚刚更新了我所有的Nu​​Get软件包,但我无法再连接到会话。我正在运行OpenTok 3.1.0和JWT 6.1.0,但在OpenTok.ConnectSession上收到以下错误:

OpenTok = new OpenTok(apiKey, apiSecret);
SessionHost = OpenTok.CreateSession(mediaMode: MediaMode.ROUTED);   <-- error here

3/1/2020 7:40:08 AM ERROR:
OpenTok: System.IO.FileLoadException: Could not load file or assembly 'JWT, Version=2.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
File name: 'JWT, Version=2.0.0.0, Culture=neutral, PublicKeyToken=null'
   at OpenTokSDK.Util.HttpClient.GenerateJwt(Int32 key, String secret, Int32 expiryPeriod)
   at OpenTokSDK.Util.HttpClient.GetCommonHeaders()
   at OpenTokSDK.Util.HttpClient.GetRequestHeaders(Dictionary`2 headers)
   at OpenTokSDK.Util.HttpClient.DoRequest(String url, Dictionary`2 specificHeaders, Dictionary`2 bodyData)
   at OpenTokSDK.OpenTok.CreateSession(String location, MediaMode mediaMode, ArchiveMode archiveMode)
   at eTutorServer.eTutorService.userIdentification(Int32 handle, String strData, String[] sAry) in D:\Data\CADE.Net\eTutorServer\eTutorServer\eTutorService.cs:line 1514

=== Pre-bind state information ===
LOG: DisplayName = JWT, Version=2.0.0.0, Culture=neutral, PublicKeyToken=null
 (Fully-specified)
LOG: Appbase = file:///D:/Data/CADE.Net/eTutorServer/eTutorServer/bin/Debug/
LOG: Initial PrivatePath = NULL
Calling assembly : OpenTok, Version=3.1.6873.25151, Culture=neutral, PublicKeyToken=null.
===
LOG: This bind starts in default load context.
LOG: Using application configuration file: D:\Data\CADE.Net\eTutorServer\eTutorServer\bin\Debug\eTutorServer.exe.Config
LOG: Using host configuration file: 
LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework64\v4.0.30319\config\machine.config.
LOG: Policy not being applied to reference at this time (private, custom, partial, or location-based assembly bind).
LOG: Attempting download of new URL file:///D:/Data/CADE.Net/eTutorServer/eTutorServer/bin/Debug/JWT.DLL.
WRN: Comparing the assembly name resulted in the mismatch: PUBLIC KEY TOKEN
ERR: Failed to complete setup of assembly (hr = 0x80131040). Probing terminated.

看来我可能有一个JWT版本控制问题,因为它在错误消息中引用了2.0.0.0,而我已经安装了6.1.0并在packages.config中。但是,我不知道为什么它将显示2.0.0.0或如何解决该问题。

c# jwt opentok
1个回答
0
投票

jdweng的评论直接导致了答案。 OpenTok不适用于6.1.0,通过卸载解决了该问题。此后发布了TokBox的问题,以找出为什么它不起作用。

© www.soinside.com 2019 - 2024. All rights reserved.