簡體   English   中英

無法在Visual Studio Ultimate 2012上安裝BenchmarkDotNet 0.10.2

[英]Can't install BenchmarkDotNet 0.10.2 on Visual Studio Ultimate 2012

我正在嘗試將BenchmarkDotNet軟件包安裝到Visual Studio 2012 Ultimate上的全新空白控制台項目中,並且出現以下錯誤日志:

PM> Install-Package BenchmarkDotNet
Attempting to resolve dependency 'BenchmarkDotNet.Toolchains.Roslyn (≥ 0.10.2)'.
Attempting to resolve dependency 'BenchmarkDotNet.Core (≥ 0.10.2)'.
Attempting to resolve dependency 'System.Threading.Tasks.Extensions (≥ 4.0.0)'.
Attempting to resolve dependency 'Microsoft.CodeAnalysis.CSharp (≥ 1.3.2)'.
Attempting to resolve dependency 'Microsoft.CodeAnalysis.Common (= 1.3.2)'.
Attempting to resolve dependency 'System.Collections.Immutable (≥ 1.1.37)'.
Attempting to resolve dependency 'System.Reflection.Metadata (≥ 1.2.0)'.
Install-Package : 'System.Reflection.Metadata' already has a dependency defined for 'System.Collections.Immutable'.
At line:1 char:1
+ Install-Package BenchmarkDotNet
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Install-Package], InvalidOperationException
    + FullyQualifiedErrorId : NuGetCmdletUnhandledException,NuGet.PowerShell.Commands.InstallPackageCommand

BenchmarkDotNet看起來非常簡單……但是它對我來說卻沒有安裝! 有沒有人遇到這個問題,或者在Visual Studio 2012上解決了這個問題?

注意:它確實安裝在Visual Studio 2015社區中,但是這不是我可以用於實際開發的版本。

通過在google上搜索,我剛剛在github上發現了與您的問題非常相似的問題。

在低於2015的Visual Studio中,似乎無法集成高於0.9.7的BenchmarkDotNet。

您應該嘗試使用0.9.7來查看它是否仍然滿足您的需求。

https://github.com/dotnet/BenchmarkDotNet/issues/237

簡短的答案:您只能在VisualStudio 2015+中安裝BenchmarkDotNet。 Visual Studio 2012使用舊版本的NuGet(2.x),它不支持某些現代程序包。 BenchmarkDotNet依賴項之一是Roslyn( Microsoft.CodeAnalysis.CSharp ),它需要NuGet 3.x +。

以下是BenchmarkDotNet和Roslyn存儲庫中有關Visual Studio最低支持版本的相關討論:

可能的解決方法:您可以在VS2015 / 2017中創建一個新的控制台項目,安裝BenchmarkDotNet,然后使用VS2012將整個項目(帶有packages文件夾)復制到您的計算機上。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM