NuGet参考在开发中工作,在生产中失败

问题描述:

我使用PushSharp来提供移动推送消息,它依赖于Newtonsoft.Json.dll。我通过NuGet安装了Newtonsoft.Json.dll,因为我也用它来做其他事情。几天前,我通过VS2012中的NuGet将Newtonsoft.Json.dll更新为v 6.x。当我在VS2012中运行项目时没有问题,但是当我部署到生产环境时,PushSharp会抛出一个异常,即Newtonsoft.Json.dll 4.5.x无法找到。根据VS2012中的NuGet Manager,PushSharp的Newtonsoft.Json.dll要求是“> = 4.5.x”。为什么它可以在我的开发机器上正常工作?我似乎无法在我的开发PC上的任何地方找到任何参考(GAC或bin)Newtonsoft.Json.dll 4.5。NuGet参考在开发中工作,在生产中失败

您可能需要添加的程序集绑定重定向到您的配置文件:

<configuration> 
    <runtime> 
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"> 
     <dependentAssembly> 
     <assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" /> 
     <bindingRedirect oldVersion="1.0.0.0-4.5.0.0" newVersion="6.0.0.0" /> 
     </dependentAssembly> 
    </assemblyBinding> 
    </runtime> 
</configuration> 
+0

谢谢。 NuGet/VS更新错误地更新了我配置的那一部分,我完全错过了它。 –

+0

没问题;乐意效劳。 –