Microsoft MVP성태의 닷넷 이야기
글쓴 사람
정성태 (techsharer at outlook.com)
홈페이지
첨부 파일
 

.NET Core + BenchmarkDotNet 실행 시 프레임워크를 찾지 못하는 문제

.NET Core Console 프로젝트에서 BenchmarkDotNet을 이용해 성능 테스트를 하는 경우 다음과 같은 출력 결과가 나올 수 있습니다.

// ***** BenchmarkRunner: Start   *****
// Found benchmarks:
//   LoopTest.ForLoopTest: DefaultJob [N=1000]
//   LoopTest.SpanLoopTest: DefaultJob [N=1000]
//   LoopTest.PtrLoopTest: DefaultJob [N=1000]
//   LoopTest.ForLoopTest: DefaultJob [N=10000]
//   LoopTest.SpanLoopTest: DefaultJob [N=10000]
//   LoopTest.PtrLoopTest: DefaultJob [N=10000]

// Validating benchmarks:
// ***** Building 6 benchmark(s) in Parallel: Start   *****
// ***** Done, took 00:00:29 (29.47 sec)   *****
// **************************
// Benchmark: LoopTest.ForLoopTest: DefaultJob [N=1000]
// *** Execute ***
// Launch: 1 / 1
It was not possible to find any compatible framework version
The specified framework 'Microsoft.NETCore.App', version '2.1.0-preview1-26216-03' was not found.
  - Check application dependencies and target a framework version installed at:
      C:\Program Files\dotnet\
  - Installing .NET Core prerequisites might help resolve this problem:
      http://go.microsoft.com/fwlink/?LinkID=798306&clcid=0x409
  - The .NET Core framework and SDK can be installed from:
      https://aka.ms/dotnet-download
  - The following versions are installed:
      1.0.5 at [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
      1.1.2 at [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
      2.0.0 at [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
      2.0.3 at [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
      2.0.4 at [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
      2.0.5 at [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
      2.0.6 at [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
      2.0.7 at [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
      2.1.0-preview1-26105-01 at [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
      2.1.0 at [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
ExitCode != 0
No more Benchmark runs will be launched as NO measurements were obtained from the previous run!


// **************************
// Benchmark: LoopTest.SpanLoopTest: DefaultJob [N=1000]
// *** Execute ***
// Launch: 1 / 1
It was not possible to find any compatible framework version
The specified framework 'Microsoft.NETCore.App', version '2.1.0-preview1-26216-03' was not found.
  - Check application dependencies and target a framework version installed at:
      C:\Program Files\dotnet\
  - Installing .NET Core prerequisites might help resolve this problem:
      http://go.microsoft.com/fwlink/?LinkID=798306&clcid=0x409
  - The .NET Core framework and SDK can be installed from:
      https://aka.ms/dotnet-download
  - The following versions are installed:
      1.0.5 at [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
      1.1.2 at [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
      2.0.0 at [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
      2.0.3 at [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
      2.0.4 at [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
      2.0.5 at [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
      2.0.6 at [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
      2.0.7 at [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
      2.1.0-preview1-26105-01 at [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
      2.1.0 at [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
ExitCode != 0
No more Benchmark runs will be launched as NO measurements were obtained from the previous run!


// **************************
// Benchmark: LoopTest.PtrLoopTest: DefaultJob [N=1000]
// *** Execute ***
// Launch: 1 / 1
It was not possible to find any compatible framework version
The specified framework 'Microsoft.NETCore.App', version '2.1.0-preview1-26216-03' was not found.
  - Check application dependencies and target a framework version installed at:
      C:\Program Files\dotnet\
  - Installing .NET Core prerequisites might help resolve this problem:
      http://go.microsoft.com/fwlink/?LinkID=798306&clcid=0x409
  - The .NET Core framework and SDK can be installed from:
      https://aka.ms/dotnet-download
  - The following versions are installed:
      1.0.5 at [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
      1.1.2 at [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
      2.0.0 at [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
      2.0.3 at [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
      2.0.4 at [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
      2.0.5 at [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
      2.0.6 at [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
      2.0.7 at [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
      2.1.0-preview1-26105-01 at [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
      2.1.0 at [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
ExitCode != 0
No more Benchmark runs will be launched as NO measurements were obtained from the previous run!


// **************************
// Benchmark: LoopTest.ForLoopTest: DefaultJob [N=10000]
// *** Execute ***
// Launch: 1 / 1
It was not possible to find any compatible framework version
The specified framework 'Microsoft.NETCore.App', version '2.1.0-preview1-26216-03' was not found.
  - Check application dependencies and target a framework version installed at:
      C:\Program Files\dotnet\
  - Installing .NET Core prerequisites might help resolve this problem:
      http://go.microsoft.com/fwlink/?LinkID=798306&clcid=0x409
  - The .NET Core framework and SDK can be installed from:
      https://aka.ms/dotnet-download
  - The following versions are installed:
      1.0.5 at [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
      1.1.2 at [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
      2.0.0 at [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
      2.0.3 at [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
      2.0.4 at [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
      2.0.5 at [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
      2.0.6 at [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
      2.0.7 at [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
      2.1.0-preview1-26105-01 at [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
      2.1.0 at [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
ExitCode != 0
No more Benchmark runs will be launched as NO measurements were obtained from the previous run!


// **************************
// Benchmark: LoopTest.SpanLoopTest: DefaultJob [N=10000]
// *** Execute ***
// Launch: 1 / 1
It was not possible to find any compatible framework version
The specified framework 'Microsoft.NETCore.App', version '2.1.0-preview1-26216-03' was not found.
  - Check application dependencies and target a framework version installed at:
      C:\Program Files\dotnet\
  - Installing .NET Core prerequisites might help resolve this problem:
      http://go.microsoft.com/fwlink/?LinkID=798306&clcid=0x409
  - The .NET Core framework and SDK can be installed from:
      https://aka.ms/dotnet-download
  - The following versions are installed:
      1.0.5 at [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
      1.1.2 at [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
      2.0.0 at [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
      2.0.3 at [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
      2.0.4 at [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
      2.0.5 at [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
      2.0.6 at [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
      2.0.7 at [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
      2.1.0-preview1-26105-01 at [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
      2.1.0 at [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
ExitCode != 0
No more Benchmark runs will be launched as NO measurements were obtained from the previous run!


// **************************
// Benchmark: LoopTest.PtrLoopTest: DefaultJob [N=10000]
// *** Execute ***
// Launch: 1 / 1
It was not possible to find any compatible framework version
The specified framework 'Microsoft.NETCore.App', version '2.1.0-preview1-26216-03' was not found.
  - Check application dependencies and target a framework version installed at:
      C:\Program Files\dotnet\
  - Installing .NET Core prerequisites might help resolve this problem:
      http://go.microsoft.com/fwlink/?LinkID=798306&clcid=0x409
  - The .NET Core framework and SDK can be installed from:
      https://aka.ms/dotnet-download
  - The following versions are installed:
      1.0.5 at [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
      1.1.2 at [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
      2.0.0 at [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
      2.0.3 at [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
      2.0.4 at [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
      2.0.5 at [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
      2.0.6 at [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
      2.0.7 at [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
      2.1.0-preview1-26105-01 at [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
      2.1.0 at [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
ExitCode != 0
No more Benchmark runs will be launched as NO measurements were obtained from the previous run!


// ***** BenchmarkRunner: Finish  *****

// * Export *
  BenchmarkDotNet.Artifacts\results\LoopTest-report.csv
  BenchmarkDotNet.Artifacts\results\LoopTest-report-github.md
  BenchmarkDotNet.Artifacts\results\LoopTest-report.html

// * Detailed results *
LoopTest.ForLoopTest: DefaultJob [N=1000]
Runtime = ; GC =
There are not any results runs

LoopTest.SpanLoopTest: DefaultJob [N=1000]
Runtime = ; GC =
There are not any results runs

LoopTest.PtrLoopTest: DefaultJob [N=1000]
Runtime = ; GC =
There are not any results runs

LoopTest.ForLoopTest: DefaultJob [N=10000]
Runtime = ; GC =
There are not any results runs

LoopTest.SpanLoopTest: DefaultJob [N=10000]
Runtime = ; GC =
There are not any results runs

LoopTest.PtrLoopTest: DefaultJob [N=10000]
Runtime = ; GC =
There are not any results runs

Total time: 00:00:29 (29.72 sec)

// * Summary *

BenchmarkDotNet=v0.10.14, OS=Windows 10.0.17134
Intel Core i5-4670 CPU 3.40GHz (Haswell), 1 CPU, 4 logical and 4 physical cores
.NET Core SDK=2.2.0-preview1-007877
  [Host] : .NET Core 2.1.0 (CoreCLR 4.6.26515.07, CoreFX 4.6.26515.06), 64bit RyuJIT


       Method |     N | Mean | Error |
------------- |------ |-----:|------:|
  ForLoopTest |  1000 |   NA |    NA |
 SpanLoopTest |  1000 |   NA |    NA |
  PtrLoopTest |  1000 |   NA |    NA |
  ForLoopTest | 10000 |   NA |    NA |
 SpanLoopTest | 10000 |   NA |    NA |
  PtrLoopTest | 10000 |   NA |    NA |

Benchmarks with issues:
  LoopTest.ForLoopTest: DefaultJob [N=1000]
  LoopTest.SpanLoopTest: DefaultJob [N=1000]
  LoopTest.PtrLoopTest: DefaultJob [N=1000]
  LoopTest.ForLoopTest: DefaultJob [N=10000]
  LoopTest.SpanLoopTest: DefaultJob [N=10000]
  LoopTest.PtrLoopTest: DefaultJob [N=10000]

// * Legends *
  N     : Value of the 'N' parameter
  Mean  : Arithmetic mean of all measurements
  Error : Half of 99.9% confidence interval
  1 ns  : 1 Nanosecond (0.000000001 sec)

// ***** BenchmarkRunner: End *****
// * Artifacts cleanup *

BenchmarkDotNet이 CoreCLR을 찾는 기준이 뭔지는 모르겠지만 메시지에 나온 "2.1.0-preview1-26216-03" 버전이 어떻게 나온 것인지 이해가 안 됩니다. 왜냐하면 (64비트로 실행한 위의 예제는) 그 버전과 관련된 dotnet 런타임 설치는 한 적이 없기 때문입니다. (물론, 제가 모를 수도 있지만!) 다음은 제 컴퓨터에 설치된 (x64 버전의) sdk와 runtime의 목록입니다.

C:\Program Files\dotnet>dotnet  --list-sdks
1.0.4 [C:\Program Files\dotnet\sdk]
1.1.0 [C:\Program Files\dotnet\sdk]
2.0.0 [C:\Program Files\dotnet\sdk]
2.0.2 [C:\Program Files\dotnet\sdk]
2.0.3 [C:\Program Files\dotnet\sdk]
2.1.2 [C:\Program Files\dotnet\sdk]
2.1.3 [C:\Program Files\dotnet\sdk]
2.1.4 [C:\Program Files\dotnet\sdk]
2.1.104 [C:\Program Files\dotnet\sdk]
2.1.200 [C:\Program Files\dotnet\sdk]
2.1.201 [C:\Program Files\dotnet\sdk]
2.1.300 [C:\Program Files\dotnet\sdk]
2.2.0-preview1-007877 [C:\Program Files\dotnet\sdk]

C:\Program Files\dotnet>dotnet  --list-runtimes
Microsoft.AspNetCore.All 2.1.0 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
Microsoft.AspNetCore.App 2.1.0 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.NETCore.App 1.0.5 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 1.1.2 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 2.0.0 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 2.0.3 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 2.0.4 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 2.0.5 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 2.0.6 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 2.0.7 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 2.1.0-preview1-26105-01 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 2.1.0 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]

어쨌든 저 목록에 없기 때문에 그런 오류가 발생한 것입니다. 관련해서 직접적인 해결 방법을 찾을 수는 없었는데요, 대신 csproj의 RuntimeFrameworkVersion을 명시하는 것으로 우회할 수 있었습니다.

<Project Sdk="Microsoft.NET.Sdk">

  <PropertyGroup>
    <OutputType>Exe</OutputType>
    <TargetFramework>netcoreapp2.1</TargetFramework>
    <RuntimeFrameworkVersion>2.1.0</RuntimeFrameworkVersion>
  </PropertyGroup>

  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
    <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
    <PlatformTarget>x64</PlatformTarget>
  </PropertyGroup>

  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
    <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
    <PlatformTarget>x64</PlatformTarget>
  </PropertyGroup>

  <ItemGroup>
    <PackageReference Include="BenchmarkDotNet" Version="0.10.14" />
  </ItemGroup>

</Project>

"dotnet --list-runtimes" 명령어로 출력된 목록 중에 원하는 버전을 RuntimeFrameworkVersion에 명시하면 .NET Core Console 응용 프로그램이 그 환경에서 동작하게 됩니다. 이럴 때 BenchmarkDotNet은 별다른 버전 찾기를 하지 않아 오류가 발생하지 않는 것 같습니다.




[이 글에 대해서 여러분들과 의견을 공유하고 싶습니다. 틀리거나 미흡한 부분 또는 의문 사항이 있으시면 언제든 댓글 남겨주십시오.]





[최초 등록일: ]
[최종 수정일: 6/13/2018 ]

Creative Commons License
이 저작물은 크리에이티브 커먼즈 코리아 저작자표시-비영리-변경금지 2.0 대한민국 라이센스에 따라 이용하실 수 있습니다.
by SeongTae Jeong, mailto:techsharer@outlook.com

비밀번호

댓글 쓴 사람
 




... 31  32  33  [34]  35  36  37  38  39  40  41  42  43  44  45  ...
NoWriterDateCnt.TitleFile(s)
11613정성태7/17/20183811Graphics: 7. Unity로 실습하는 Shader (5) - Flat Shading
11612정성태7/16/20183170Windows: 148. Windows - Raw Input의 Top level collection 의미
11611정성태8/3/20183992Graphics: 6. Unity로 실습하는 Shader (4) - 퐁 셰이딩(phong shading)
11610정성태8/3/20182599Graphics: 5. Unity로 실습하는 Shader (3) - 고로 셰이딩(gouraud shading) + 퐁 모델(Phong model) + Texture
11609정성태8/3/20183760Graphics: 4. Unity로 실습하는 Shader (2) - 고로 셰이딩(gouraud shading) + 퐁 모델(Phong model)
11608정성태7/17/20186064Graphics: 3. Unity로 실습하는 Shader (1) - 컬러 반전 및 상하/좌우 뒤집기
11607정성태8/30/20186018Graphics: 2. Unity로 실습하는 Shader
11606정성태8/14/20186612사물인터넷: 19. PC에 연결해 동작하는 자신만의 USB 장치 만들어 보기파일 다운로드1
11605정성태8/9/20183418사물인터넷: 18. New NodeMcu v3 아두이노 호환 보드의 내장 LED 및 입력 핀 사용법파일 다운로드1
11604정성태7/12/20182871Math: 47. GeoGebra 기하 (24) - 정다각형파일 다운로드1
11603정성태7/12/20182413Math: 46. GeoGebra 기하 (23) - sqrt(n) 제곱근파일 다운로드1
11602정성태7/11/20182670Math: 45. GeoGebra 기하 (22) - 반전기하학의 원에 관한 반사변환파일 다운로드1
11601정성태7/11/20183091Math: 44. GeoGebra 기하 (21) - 반전기하학의 직선 및 원에 관한 반사변환파일 다운로드1
11600정성태7/10/20182933Math: 43. GeoGebra 기하 (20) - 세 점을 지나는 원파일 다운로드1
11599정성태7/10/20182417Math: 42. GeoGebra 기하 (19) - 두 원의 안과 밖으로 접하는 직선파일 다운로드1
11598정성태7/10/20182402Windows: 147. 시스템 복구 디스크를 USB 디스크에 만드는 방법
11597정성태8/9/20183074사물인터넷: 17. Thinary Electronic - ATmega328PB 아두이노 호환 보드의 개발 환경 구성
11596정성태7/10/20182691기타: 72. 과거의 용어 설명 - OWIN
11595정성태11/20/20186217사물인터넷: 16. New NodeMcu v3 아두이노 호환 보드의 기본 개발 환경 구성
11594정성태7/8/20183228Math: 41. GeoGebra 기하 (18) - 원의 중심 및 접선파일 다운로드1
11593정성태7/8/20182923Math: 40. GeoGebra 기하 (17) - 각의 복사파일 다운로드1
11591정성태7/7/20182745Math: 39. GeoGebra 기하 (16) - 삼각형의 방심과 방접원파일 다운로드1
11590정성태7/7/20182240Math: 38. GeoGebra 기하 (15) - 삼각형의 수심파일 다운로드1
11589정성태7/7/20183038.NET Framework: 787. object로 형변환된 인스턴스를 원래의 타입 인자로 제네릭 메서드를 호출하는 방법 [2]파일 다운로드1
11588정성태12/19/20192890디버깅 기술: 116. windbg 분석 사례 - ASP.NET 웹 응용 프로그램의 CPU 100% 현상
11587정성태7/5/20182567.NET Framework: 786. ASP.NET - HttpCookieCollection을 다중 스레드에서 사용할 경우 무한 루프 현상
... 31  32  33  [34]  35  36  37  38  39  40  41  42  43  44  45  ...