简体   繁体   English

NuGet软件包(SharpDX)无法在VS2012中安装并出现错误

[英]NuGet package (SharpDX) fails to install with error in VS2012

I'm trying to install SharpDX v2.6.2 via NuGet Package Manager console. 我正在尝试通过NuGet Package Manager控制台安装SharpDX v2.6.2。 I kept getting errors so I tried a completely new WPF solution. 我不断收到错误,所以尝试了全新的WPF解决方案。 Here are the steps I've tried and resulting error message: 这是我尝试过的步骤以及产生的错误消息:

1. Create a completely New WPF Application, Target .NET4.0 1.创建一个全新的WPF应用程序Target .NET4.0

在此处输入图片说明

2. Open up Package Manager Console and run the Install command 2.打开Package Manager控制台并运行Install命令

From the SharpDX NuGet Page SharpDX NuGet页面

>> PM Install-Package SharpDX

However, this fails with the following output in the Package Manager Console 但是,此操作失败,并在Package Manager控制台中显示以下输出

Package Manager Console Host Version 2.0.30625.9003

Type 'get-help NuGet' to see all available NuGet commands.

PM> Install-Package SharpDX
Successfully installed 'SharpDX 2.6.2'.
Successfully added 'SharpDX 2.6.2' to SharpDXTest.
Installing [SharpDX] to project [C:\Users\Andrew\SharpDXTest\SharpDXTest\SharpDXTest.csproj]
Uninstalling [SharpDX] from project [C:\Users\Andrew\SharpDXTest\SharpDXTest\SharpDXTest.csproj]
Successfully uninstalled 'SharpDX 2.6.2'.
Install failed. Rolling back...
Install-Package : SharpDX.targets import not found in project [C:\Users\Andrew\SharpDXTest\SharpDXTest\SharpDXTest.csproj]
At line:1 char:1
+ Install-Package SharpDX
+ ~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Install-Package], RuntimeException
    + FullyQualifiedErrorId : NuGetCmdletUnhandledException,NuGet.PowerShell.Commands.InstallPackageCommand

I'm totally stumped! 我完全迷住了! :S Other packages seem to install just fine, but SharpDX doesn't. :S其他软件包似乎安装得很好,但是SharpDX不能。 Any suggestions? 有什么建议么?

Update: I managed to fix it. 更新:我设法解决了。 I basically had to install the latest version of NuGet (v2.8.2) not v2.0. 我基本上必须安装最新版本的NuGet(v2.8.2),而不是v2.0。

Also performing the install in VS2013 seemed to have better results on an existing solution than 2012. 与2012年相比,在VS2013中执行安装似乎也比现有解决方案有更好的结果。

Hope this helps someone, 希望这对某人有帮助,

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM