无法加载文件或程序集'Microsoft.IdentityModel.Tokens,Version = 5.2.0.0 [英] Could not load file or assembly 'Microsoft.IdentityModel.Tokens, Version=5.2.0.0

查看:134
本文介绍了无法加载文件或程序集'Microsoft.IdentityModel.Tokens,Version = 5.2.0.0的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用VS 2015将OWIN JWT添加到webapi项目中.该参考显示 Microsoft.Owin.Security.Jwt,Version = 4.0.0.0 Microsoft.IdentityModel.Tokens版本= 5.3.0.0 .下面是运行时的错误.我在源代码中找不到 5.2.0.0 .

I am trying to add OWIN JWT into webapi project using VS 2015. The reference shows Microsoft.Owin.Security.Jwt, Version=4.0.0.0 and Microsoft.IdentityModel.Tokens Version=5.3.0.0. Below is the error when running. I could not find 5.2.0.0 in the source code.

=== Pre-bind state information ===
LOG: DisplayName = Microsoft.IdentityModel.Tokens, Version=5.2.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
 (Fully-specified)
LOG: Appbase = file:///C:/Users/xxx/Documents/xxx/WebApi/
LOG: Initial PrivatePath = C:\Users\xxx\Documents\xxx\WebApi\bin
Calling assembly : Microsoft.Owin.Security.Jwt, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35.

请问有什么主意吗?

推荐答案

首先,您应该了解发生的异常不仅限于Microsoft.IdentityModel.Tokens程序集,也不限于Visual Studio版本.该问题在程序集引用中很普遍.

First, you should understand that the exception occurred is not restricted to Microsoft.IdentityModel.Tokens assembly, nor the Visual Studio Version. the problem is popular with the assembly referencing.

普遍的原因是:您在项目中引用的版本不同于执行中使用的"DLL"包(bin文件夹)中的版本.但是,我认为这远比手动发生更远.

the popular reason is: you are referencing in the project to a version different than in the "DLL" package used in the execution (bin folder). However, I think this farther than getting happened manually.

1-我可以根据程序集名称进行猜测.您的解决方案中有多个项目,最后使用NuGet安装了程序集,而该版本的版本高于其他项目(当然使用NuGet)

1- I can guess based on the assembly name. that you have more than one project in your solution and you lastly installed the assembly using NuGet with a version higher than in other projects (of course using NuGet )

尝试验证所有项目中已安装的软件包,并将它们全部更新为最新的Version = 5.3.0.0.

Try to verify the installed package in all your projects and update all of them to the latest one Version=5.3.0.0.

另一个可能的原因是:此程序包需要Microsoft.IdentityModel.Logging尝试执行上面第1点所述的相同操作.

Another potential reason is: this package requires the Microsoft.IdentityModel.Logging try to do the same operation explained above in point 1.

这篇关于无法加载文件或程序集'Microsoft.IdentityModel.Tokens,Version = 5.2.0.0的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆