ASP.NET VNEXT DNU还原错误

时间:2015-05-29 16:30:17

标签: asp.net json.net visual-studio-2015

每当我尝试在visual studio中执行包恢复时,我都会收到以下错误。当使用github中的样本和命令提示符(即

)时,我也会遇到同样的错误
C:\Users\xxxxxx\Documents\GitHub\aspnet\samples\1.0.0-beta4\HelloMvc dnu restore)

我将执行环境设置为使用以下dnx -dnvm use 1.0.0-beta4 -r clr -arch x86 -p

我尝试从.dnx / packages中删除软件包,并尝试更换运行时,但似乎没有任何效果。

这可能是因为在CTP 6上安装visual studio 2015 RC;但是,我尝试多次卸载并重新安装visual studio。

任何帮助将不胜感激。

Writing lock file C:\Users\xxxxxx\Documents\Visual Studio 2015\Projects\test3\src\test3\project.lock.json
----------
System.MissingMethodException: **Method not found: 'Newtonsoft.Json.Linq.JValue Newtonsoft.Json.Linq.JValue.CreateNull()'.**
   at Microsoft.Framework.Runtime.DependencyManagement.LockFileFormat.WriteString(String item)
   at Microsoft.Framework.Runtime.DependencyManagement.LockFileFormat.WriteArray[TItem](IEnumerable`1 items, Func`2 writeItem)
   at Microsoft.Framework.Runtime.DependencyManagement.LockFileFormat.WriteProjectFileDependencyGroup(ProjectFileDependencyGroup frameworkInfo)
   at Microsoft.Framework.Runtime.DependencyManagement.LockFileFormat.WriteObject[TItem](IEnumerable`1 items, Func`2 writeItem)
   at Microsoft.Framework.Runtime.DependencyManagement.LockFileFormat.WriteLockFile(LockFile lockFile)
   at Microsoft.Framework.Runtime.DependencyManagement.LockFileFormat.Write(Stream stream, LockFile lockFile)
   at Microsoft.Framework.Runtime.DependencyManagement.LockFileFormat.Write(String filePath, LockFile lockFile)
   at Microsoft.Framework.PackageManager.RestoreCommand.WriteLockFile(String projectLockFilePath, Project project, List`1 graphItems, PackageRepository repository, IEnumerable`1 frameworks)
   at Microsoft.Framework.PackageManager.RestoreCommand.<RestoreForProject>d__74.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.Framework.PackageManager.RestoreCommand.<>c__DisplayClass73_0.<<ExecuteCommand>b__0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.Framework.PackageManager.RestoreCommand.<ExecuteCommand>d__73.MoveNext()
----------
Restore failed
Method not found: 'Newtonsoft.Json.Linq.JValue Newtonsoft.Json.Linq.JValue.CreateNull()'.

1 个答案:

答案 0 :(得分:1)

发现问题:Newtonsoft.json.dll版本6.0.3不包含CreateNull方法。将版本6.0.8添加到GAC,一切正常。