ASP.NET 5 RC1 - 无法加载文件或程序集Newtonsoft.Json

时间:2016-01-10 06:47:09

标签: json.net asp.net-core

升级到Newtonsoft.Json 8.0.2之后,我开始在我的ASP.NET 5 RC1应用程序上收到以下错误,而且我不确定如何解决它。在旧版本下,我们将使用BindingRedirect。我们如何在新的vNEXT版本的ASP.NET中解决这个问题

System.IO.FileNotFoundException: Could not load file or assembly 'Newtonsoft.Json, Version=6.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed' or one of its dependencies. The system cannot find the file specified. File name: 'Newtonsoft.Json, Version=6.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed' at Microsoft.Extensions.Configuration.Json.JsonConfigurationProvider.Load(Stream stream) at Microsoft.Extensions.Configuration.Json.JsonConfigurationProvider.Load() at Microsoft.Extensions.Configuration.ConfigurationBuilder.Add(IConfigurationProvider provider) at Microsoft.Extensions.Configuration.JsonConfigurationExtensions.AddJsonFile(IConfigurationBuilder configurationBuilder, String path, Boolean optional) at Microsoft.AspNet.Hosting.WebApplication.Run(Type startupType, String[] args) at Microsoft.AspNet.Server.Kestrel.Program.Main(String[] args) --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at Microsoft.Dnx.Runtime.Common.EntryPointExecutor.Execute(Assembly assembly, String[] args, IServiceProvider serviceProvider) at Microsoft.Dnx.ApplicationHost.Program.<>c__DisplayClass3_0.<ExecuteMain>b__0() at System.Threading.Tasks.Task`1.InnerInvoke() at System.Threading.Tasks.Task.Execute()

1 个答案:

答案 0 :(得分:0)

好的,为了解决这个问题,我不得不删除WRAP / Newtonsoft.Json文件夹。显然,安装新版本会在WRAP文件夹中为其创建一个条目。一旦我从那里删除它,我的应用程序再次正常运行。