通过Visual Studio中的程序包管理器控制台安装TestStack.White

时间:2016-01-19 04:32:41

标签: c++ visual-studio package ui-automation nuget-package

我正在尝试通过Visual Studio中的程序包管理器控制台使用NuGet安装TestStack.White但是当我在程序包管理器控制台中输入“Install-Package TestStack.White”命令时出现此错误:

Installing 'Castle.Core 3.3.3'.
Successfully installed 'Castle.Core 3.3.3'.
Installing 'TestStack.White 0.13.3'.
Successfully installed 'TestStack.White 0.13.3'.
The names of some imported commands from the module 'TestStack.White' include unapproved verbs that might make them less discoverable. To find the commands with unapproved verbs, run the Import-Module command again with the Verbose parameter. For a list of approved verbs, type Get-Verb.
Adding 'Castle.Core 3.3.3' to PSTableManager.
Uninstalling 'Castle.Core 3.3.3'.
Successfully uninstalled 'Castle.Core 3.3.3'.
Install failed. Rolling back...
Install-Package : Could not install package 'Castle.Core 3.3.3'. You are trying to install this package into a project that targets 'Native,Version=v0.0', 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.
At line:1 char:1

我做错了吗?我该如何解决这个问题?

1 个答案:

答案 0 :(得分:1)

您无法安装此软件包的原因是它与您的项目不兼容。包TestStack.White是基于.NET的(托管),因此无法添加到本机C ++项目中:

You are trying to install this package into a project that targets 'Native,Version=v0.0', but the package does 
not contain any assembly references or content files that are compatible with that framework.

有一个C ++的托管版本,它叫做C ++ / CLI。您可以尝试将其与TestStack.White包一起使用。但是,这取决于项目的要求。如果必须创建本机应用程序,则不能使用C ++ / CLI。