JSams
JSams

Reputation: 55

ASP.NET VNEXT DNU Restore error

Every time I try to perform a package restore in visual studio, I get the error below. I also get the same error when using the samples from github with the command prompt i.e (

C:\Users\xxxxxx\Documents\GitHub\aspnet\samples\1.0.0-beta4\HelloMvc dnu restore)

I set my execution environment to use the following dnx -dnvm use 1.0.0-beta4 -r clr -arch x86 -p

I have tried deleting the packages from .dnx/packages and have tried replacing the runtimes, but nothing seems to work.

This may be a result of installing visual studio 2015 RC over the CTP 6; however, I have tried uninstalling and re-installing visual studio multiple times.

Any help would be appreciated.

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()'.

Upvotes: 0

Views: 713

Answers (1)

JSams
JSams

Reputation: 55

Found the issue: Newtonsoft.json.dll verion 6.0.3 does not contain the CreateNull method. Added version 6.0.8 to the GAC and everything worked.

Upvotes: 1

Related Questions