Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Nugets install in visual studio 2015

I try to install the nuget Microsoft.VisualStudio.QualityTools.UnitTestFramework in Visual Studio 2015 in simple project and got this message:

Could not install package 'Microsoft.VisualStudio.QualityTools.UnitTestFramework 10.0.30319.1'. You are trying to install this package into a project that targets '.NETFramework,Version=v4.5.2', but the package does not contain any assembly references or content files that are compatible with that framework. For more information, contact the package author.

But, when I try to install this package in Visual Studio 2013 in the same project this is work.

How can I install this nuget in Visual Studio 2015?

like image 796
ran Avatar asked Dec 25 '15 13:12

ran


2 Answers

Time has passed, but it is happening to me, and I have found that it has nothing to do with the framework version. The important text of the error message is: "...but the package does not contain any assembly references or content files...".

Indeed, my package does not have any visible content for Nuget: it has a non conventional folder with third party native libraries and a Install.ps1 that adds a post build event with a Xcopy command.

As an easy turnaround, just put a dummy file in the package Content folder or any other dummy content in lib, empty file node (not tried it), etc.

EDIT 29/5/2017

I am seeing that this answer is useful to others, and that is why I am going to elaborate a little more.

As I said, the problem is that Nuget don't see there is any content in the package, but it may have two causes:

  1. The package really does not have visible content because it moves the content with a script, etc. (as it was my case), and then it is necessary to create some dummy content as a workaround.

  2. There's a mistake in the specification of a package that must have content (as was the case of Evgeni Nabokov in the comments), and then you have to correct the specification to put things in place.

Sorry for my bad english.

like image 140
SERWare Avatar answered Sep 23 '22 13:09

SERWare


The error message is saying you that there is no version of nuget for your framework version.

In VS2013 You probably create the project in 4.5.0 or 4.0.0 version of .Net framework.

Have you tried to change .Net version of your project to 4.5.2 ?

like image 41
Andrius Avatar answered Sep 20 '22 13:09

Andrius