Asp.net MVC4网站托管问题

时间:2014-12-16 06:30:50

标签: c# asp.net-mvc-4 iis json.net

我使用VS2010开发了一个asp.net mvc4网站,在将其发布并托管到同一个开发者计算机后,它运行得非常好。

然后我托管了同样的测试系统,它只安装了.net框架(4.5.1)和asp.net mvc4运行时,然后它给出了运行时异常,说明

Could not load file or assembly 'Newtonsoft.Json, Version=4.5.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed' or one of its dependencies. The system cannot find the file specified.

我检查了我项目中的所有引用,但没有引用Newtonsoft.Json。非常感谢任何帮助。

请参阅屏幕截图enter image description here

1 个答案:

答案 0 :(得分:0)

我想在你的web.config中你有像

这样的行
<dependentAssembly>
 <assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
 <bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.0.0" />
 </dependentAssembly>

删除那些在这种情况下会产生错误的错误,并从nuget更新该包:)

相关问题