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

비밀번호

댓글 쓴 사람
 




... 16  17  18  19  20  21  22  23  24  25  26  27  28  29  [30]  ...
NoWriterDateCnt.TitleFile(s)
11622정성태7/23/20183991개발 환경 구성: 388. Windows 환경에서 Octave 패키지 설치하는 방법
11621정성태7/23/20182930VC++: 127. 멤버 함수에 대한 포인터를 외부에서 호출하는 방법파일 다운로드1
11620정성태8/3/20184511Graphics: 11. Unity로 실습하는 Shader (7) - Blur (평균값, 가우스, 중간값) 필터파일 다운로드1
11619정성태7/21/20183258Graphics: 10. Unity로 실습하는 Shader (6) - Mosaic Shading
11618정성태4/28/20202954개발 환경 구성: 387. 삼성 오디세이(Odyssey) 노트북의 운영체제를 새로 설치하는 방법
11617정성태7/20/20182982Team Foundation Server: 50. TFS 소스 코드 관리 기능 (5) - "Rollback", "Rollback Entire Changeset"
11616정성태7/17/20182818Graphics: 9. Unity Shader - 전역 변수의 초기화
11615정성태7/17/20183925.NET Framework: 788. RawInput을 이용한 키보드/마우스 입력 모니터링파일 다운로드1
11614정성태7/20/20185258Graphics: 8. Unity Shader - Texture의 UV 좌표에 대응하는 Pixel 좌표
11613정성태7/17/20183537Graphics: 7. Unity로 실습하는 Shader (5) - Flat Shading
11612정성태7/16/20183064Windows: 148. Windows - Raw Input의 Top level collection 의미
11611정성태8/3/20183726Graphics: 6. Unity로 실습하는 Shader (4) - 퐁 셰이딩(phong shading)
11610정성태8/3/20182501Graphics: 5. Unity로 실습하는 Shader (3) - 고로 셰이딩(gouraud shading) + 퐁 모델(Phong model) + Texture
11609정성태8/3/20183530Graphics: 4. Unity로 실습하는 Shader (2) - 고로 셰이딩(gouraud shading) + 퐁 모델(Phong model)
11608정성태7/17/20185725Graphics: 3. Unity로 실습하는 Shader (1) - 컬러 반전 및 상하/좌우 뒤집기
11607정성태8/30/20185710Graphics: 2. Unity로 실습하는 Shader
11606정성태8/14/20186186사물인터넷: 19. PC에 연결해 동작하는 자신만의 USB 장치 만들어 보기파일 다운로드1
11605정성태8/9/20183223사물인터넷: 18. New NodeMcu v3 아두이노 호환 보드의 내장 LED 및 입력 핀 사용법파일 다운로드1
11604정성태7/12/20182697Math: 47. GeoGebra 기하 (24) - 정다각형파일 다운로드1
11603정성태7/12/20182331Math: 46. GeoGebra 기하 (23) - sqrt(n) 제곱근파일 다운로드1
11602정성태7/11/20182536Math: 45. GeoGebra 기하 (22) - 반전기하학의 원에 관한 반사변환파일 다운로드1
11601정성태7/11/20182865Math: 44. GeoGebra 기하 (21) - 반전기하학의 직선 및 원에 관한 반사변환파일 다운로드1
11600정성태7/10/20182783Math: 43. GeoGebra 기하 (20) - 세 점을 지나는 원파일 다운로드1
11599정성태7/10/20182314Math: 42. GeoGebra 기하 (19) - 두 원의 안과 밖으로 접하는 직선파일 다운로드1
11598정성태7/10/20182280Windows: 147. 시스템 복구 디스크를 USB 디스크에 만드는 방법
11597정성태8/9/20182826사물인터넷: 17. Thinary Electronic - ATmega328PB 아두이노 호환 보드의 개발 환경 구성
... 16  17  18  19  20  21  22  23  24  25  26  27  28  29  [30]  ...