Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cannot add Nuget packages to ASP.NET vNext project

So I decided to take a look at this new Visual Studio 14 CTP. When I tried to add a package from Nuget library (Raven Database Server precisely) to my ASP.NET vNext Web Application, it felt like nothing really happened. Not a single piece of solution has changed, and the References remained the same.

I tried adding it manually using my "Project.json" file (as seen in this article), but IntelliSense didn't provide me with any fill. I actually tried it in a lot of different ways, with a whole lot of Nuget packages, with the same result.

Can anybody explain this situation?

like image 658
Constantine Yevseyev Avatar asked Mar 20 '23 08:03

Constantine Yevseyev


1 Answers

ASP.NET vNext supports two targets: .NET 4.5 and CoreCLR. When targeting .NET 4.5 (net45) you can add any existing NuGet reference. When targeting CoreCLR (k10) you can only add NuGet references that support it; today, only some packages support that.

The package that you mention is only available for net45. To add a reference to it, add the package as a dependecy in the net45 section of project.json - just like autofac is added in this file

The entry should be: "RavenDB.Server":"2.5.2879"

PS: the manage NuGet references dialog is not functional for ASP.NET vNext projects in this version of VS

like image 63
Victor Hurdugaci Avatar answered Apr 01 '23 13:04

Victor Hurdugaci