Updating NuGet packages in ASP.NET MVC 6

9

I just created a new ASP.NET MVC 6 project and wanted to update the NuGet packages to their latest versions (The default project templates are usually very out of date). I noticed the following updates were possible:

  • Antlr.3.4.1.9004 > Antlr.3.5.0.2
  • Newtonsoft.Json.6.0.4 > Newtonsoft.Json.6.0.8
  • WebGrease.1.5.2 > WebGrease.1.6.0

When I try to upgrade these packages wither using the NuGet package dialog or updating the version numbers in the project.json file for Newtonsoft.json, I get errors.

1) Severity Code Description Project File Line Error Not implemented (Exception from HRESULT: 0x80004001 (E_NOTIMPL)) 0

2) Severity Code Description Project File Line Error NuGet Package Restore failed for one or more packages. See details in the Output window. Mvc6ProjectName C:[PATH TO MY FOLDER]\Source\Mvc6ProjectName\project.json 0

3) Severity Code Description Project File Line Error Dependency Newtonsoft.Json >= 6.0.8 could not be resolved Mvc6Boilerplate C:\Git\ASP.NET-MVC-Boilerplate\Source\MVC6\Mvc6Boilerplate\project.json 19

I also have a MVC project and am using the latest NuGet packages there so why can't I upgrade these packages? Is this to do with the fact that there is no more web.config file where we can specify runtime assemblyBinding's:

<runtime>
  <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
    <dependentAssembly>
      <assemblyIdentity name="Newtonsoft.Json" culture="neutral" publicKeyToken="30ad4fe6b2a6aeed" />
      <bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.0.0" />
    </dependentAssembly>
  </assemblyBinding>
</runtime>

Update 1

When I try to update Newtonsoft.Json from the package manager console, I get the error below:

PM> Update-Package Newtonsoft.Json -ProjectName Mvc6Boilerplate -Version 6.0.8 Package with the Id 'Newtonsoft.Json' is not installed to project 'Mvc6Boilerplate'.

It seems that Newtonsoft.Json is not installed in the default MVC 6 project but is installed as a dependency of another project. This NuGet package is not actually displayed in the Nuget Package Manager either but is displayed in the project.json file and also under the References->DNX and DNX Core tree view item.

When I try to explicitly install the Newtonsoft.Json package, it does upgrade to 6.0.8 but I then get the errors I listed above.

c#
asp.net
asp.net-mvc
nuget
asp.net-core-mvc
asked on Stack Overflow May 19, 2015 by Muhammad Rehan Saeed • edited May 19, 2015 by Muhammad Rehan Saeed

3 Answers

2

This error: "Severity Code Description Project File Line Error NuGet Package Restore failed for one or more packages. See details in the Output window."

...was resolved for me by ensuring I was running VisualStudio as an Administrator.

Although, the page did not fully render well on the first build.

answered on Stack Overflow May 20, 2015 by ddisqq
0

The easiest solution that I know of right now is to use Visual Studio 2013 instead of 2015 to upgrade your packages.

answered on Stack Overflow Aug 25, 2015 by Serj Sagan
0

It seems that the problem has been resolved. You have to update your NugetPackage Manager:

Tools > Extensions and Updates > Updates > Visual Studio Gallery

answered on Stack Overflow Nov 5, 2015 by user5529089

User contributions licensed under CC BY-SA 3.0