问题描述
我尝试在简单项目中的Visual Studio 2015中安装nuget Microsoft.VisualStudio.QualityTools.UnitTestFramework
并得到以下消息:
I try to install the nuget Microsoft.VisualStudio.QualityTools.UnitTestFramework
in Visual Studio 2015 in simple project and got this message:
但是,当我尝试在同一项目中的Visual Studio 2013中安装此程序包时,这是可行的。
But, when I try to install this package in Visual Studio 2013 in the same project this is work.
如何在Visual Studio 2015中安装此nuget?
How can I install this nuget in Visual Studio 2015?
推荐答案
时间已经过去,但是它正在发生,我发现它与框架版本无关。错误消息的重要文本是: ...但程序包不包含任何程序集引用或内容文件...。
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...".
确实,我的程序包确实Nuget没有任何可见的内容:它具有一个非常规的文件夹,其中包含第三方本机库,以及一个Install.ps1,它使用Xcopy命令添加了构建后事件。
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.
作为一个简单的解决方法,只需将伪文件放入程序包的Content文件夹中,或将任何其他伪内容放入lib,空文件节点(未尝试过)等中。
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
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.
正如我所说,问题在于Nuget看不到软件包中的任何内容,但是可能有两个原因:
As I said, the problem is that Nuget don't see there is any content in the package, but it may have two causes:
-
该软件包实际上没有可见的内容,因为它使用脚本等移动内容(就像我的情况一样),然后有必要创建一些虚拟内容作为解决方法。
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.
在必须包含内容的软件包的规范中有一个错误(就像评论中的Evgeni Nabokov一样),然后您必须更正规范才能将其放到位。
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.
这篇关于Nugets安装在Visual Studio 2015中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!