NuGet 更新,现在抛出 OpenTok:System.IO.FileLoadException:无法在 CreateSession 上加载文件或程序集 JWT Version=2.0.0.0
NuGet update, now throwing OpenTok: System.IO.FileLoadException: Could not load file or assembly JWT Version=2.0.0.0 on CreateSession
我刚刚更新了所有 NuGet 程序包,但我无法再连接到会话。我是 运行 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 或如何解决它。
jdweng 的评论直接导致了答案。 OpenTok 不适用于 6.1.0,卸载解决了这个问题。此后发布了 TokBox 问题,以找出它不起作用的原因。
我刚刚更新了所有 NuGet 程序包,但我无法再连接到会话。我是 运行 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 或如何解决它。
jdweng 的评论直接导致了答案。 OpenTok 不适用于 6.1.0,卸载解决了这个问题。此后发布了 TokBox 问题,以找出它不起作用的原因。