[英]MVC 4 with OWIN
Breakdown : 细目 :
Tried to run project, but gave me this error : 试图运行项目,但给了我这个错误 :
"Could not load file or assembly 'Newtonsoft.Json, Version=4.5.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)" “无法加载文件或程序集'Newtonsoft.Json,版本= 4.5.0.0,区域性=中性,PublicKeyToken = 30ad4fe6b2a6aeed”或其依赖项之一。找到的程序集的清单定义与程序集引用不匹配。(来自HRESULT的异常:0x80131040 )”
I'm at a loss with what to do now. 我不知道该怎么办。 I can't even run my project even after bringing 4.5 back. 即使恢复了4.5,我什至无法运行我的项目。 Can I keep trying to change my .NET framework version, or at this point, should I just install a lower version of OWIN? 我是否可以继续尝试更改.NET Framework版本,或者此时是否应该仅安装较低版本的OWIN? Thanks 谢谢
EDIT I have tried to reinstall newtonsoft in the package manager console through a code I found on here, which didnt work 编辑我试图通过我在这里找到的代码在软件包管理器控制台中重新安装newtonsoft,但没有用
Solved this problem by reverting my project back to .NET framework 4.5, and installing an older version of OWIN 通过将项目恢复为.NET Framework 4.5并安装较旧版本的OWIN解决了此问题
In the package manager console: 在包管理器控制台中:
Install-Package Microsoft.Owin.Host.SystemWeb -Version 2.1.0
then also add: 然后还添加:
<add key="owin:AutomaticAppStartup" value="false" />
to <appSettings>
in Web.config file if errors about OwinStartupAttribute show up. 如果出现有关OwinStartupAttribute的错误,请转到Web.config文件中的<appSettings>
。
Apparently the main problem I had was because I was using VS2012, which is not supported by NuGet 2.12 , the version needed for the latest OWIN. 显然,我遇到的主要问题是因为我使用的是VS2012,而NuGet 2.12 (最新OWIN所需的版本) 不支持 VS2012。
Thanks to everyone's help 多亏大家的帮助
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.