Benchmarkdotnet: Brand new machine with VS 2015 only b0rks

Created on 4 Apr 2016  Â·  14Comments  Â·  Source: dotnet/BenchmarkDotNet

When running BDN 0.9.4 on a brand new machine with VS 2015 only installed I get this beatiful thing:

Unhandled Exception: System.IO.FileLoadException: Could not load file or assembly 'Microsoft.Build.Framework, Version=12.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
   at BenchmarkDotNet.Toolchains.Classic.ClassicBuilder.Build(GenerateResult generateResult, ILogger logger, Benchmark benchmark)
   at BenchmarkDotNet.Running.BenchmarkRunner.Build(ILogger logger, IToolchain toolchain, GenerateResult generateResult, Benchmark benchmark)
   at BenchmarkDotNet.Running.BenchmarkRunner.Run(Benchmark benchmark, ILogger logger, IConfig config)
   at BenchmarkDotNet.Running.BenchmarkRunner.Run(IList`1 benchmarks, ILogger logger, String title, IConfig config)
   at BenchmarkDotNet.Running.BenchmarkRunner.Run(IList`1 benchmarks, IConfig config)
   at LogRenderer.HCRenderer.Main(String[] args) in C:\dev\Snippets\HCLog\HCLog\LogRenderer\HCRenderer.cs:line 129

Looks like there is no support for Microsoft.Build.Framework v14.0 (which is the only thing I have installed in the GAC)...

bug

Most helpful comment

FYI I just just got this exact error with Visual Studio 2015, targetting .NET 4.5.1 and referencing the latest nuget (0.9.5). We're currently referencing 4.5.1 for the time being.

All 14 comments

Thanks for reporting the bug. It is already fixed #132, but not yet released (will be part of 0.9.5 version). If you do not want to wait for the release please Install msbuild 12

I was not 100% right. In #132 the user was getting FileNotFoundException, but you got FileLoadException which has not been handled yet. I added the right handler. Thanks once again and sorry for inconvinience!

+1

I'm getting the following now this morning when I reverted to 0.9.3


// *** Build ***
   Exceptionless.Tests.Plugins.PluginTests.RunBenchmark [FAIL]
      System.IO.FileNotFoundException : Could not load file or assembly 'Microsoft.Build.Framework, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.\r\n---- System.IO.FileNotFoundException : Could not load file or assembly 'Microsoft.Build.Framework, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.
      Stack Trace:
            at BenchmarkDotNet.Toolchains.Classic.ClassicBuilder.Build(GenerateResult generateResult, ILogger logger, Benchmark benchmark)
            at BenchmarkDotNet.Running.BenchmarkRunner.Build(ILogger logger, IToolchain toolchain, GenerateResult generateResult, Benchmark benchmark)
            at BenchmarkDotNet.Running.BenchmarkRunner.Run(Benchmark benchmark, ILogger logger, IConfig config)
            at BenchmarkDotNet.Running.BenchmarkRunner.Run(IList`1 benchmarks, ILogger logger, String title, IConfig config)
            at BenchmarkDotNet.Running.BenchmarkRunner.Run(IList`1 benchmarks, IConfig config)
            at BenchmarkDotNet.Running.BenchmarkRunner.Run[T](IConfig config)
         Source\Tests\Plugins\PluginTests.cs(636,0): at Exceptionless.Tests.Plugins.PluginTests.RunBenchmark()
         ----- Inner Stack Trace -----

File: 6303744
File: 6405318
File: 3151872

https://ci.appveyor.com/project/Exceptionless/exceptionless-net

Is it possible to generate a vs12 solution instead of a vs14?

We are using VS12 build image

Hi @niemyjski The bug is already fixed, but it's waiting for the Release (probably end of the next week). For .NET 4.5 target we are going to reference MSBuild 12 dlls, for .NET 4.6 MSBuild 14 dlls. We will also have a fallback mechanism in case when dll are not found we will just execute bash script that will do simple call to msbuild

As far as I can tell this should have been part of 0.9.5 but this still happens to me on a brand new machine with 0.9.5

@damageboy which .NET framework is your benchmark project targeting? It should be .NET 4.6 or higher

I'm targeting 4.5 on a machine that only has. Vs2015 installed and I get tons of errors with the latest version

BenchmarkDotNet for .NET 4.5 references MSBuild12 (VS 2013), for .NET 4.6 MSBuild 14 (VS 2015).

Could you please try removing BDN form your benchmark project, upgrade it to .NET 4.6 and install BDN 0.95 ?

Negative, we reference 4.5 explicitly because there are issues with using
the .net 4.6 compiler / toolchain when targeting pcl projects. As such
everything that runs as part of this build cannot be any higher than 4.5

Thanks
-Blake Niemyjski

On Tue, May 3, 2016 at 11:10 AM, Adam Sitnik [email protected]
wrote:

BenchmarkDotNet for .NET 4.5 references MSBuild12 (VS 2013), for .NET 4.6
MSBuild 14 (VS 2015).

Could you please try removing BDN form your benchmark project, upgrade it
to .NET 4.6 and install BDN 0.95 ?

—
You are receiving this because you were mentioned.
Reply to this email directly or view it on GitHub
https://github.com/PerfDotNet/BenchmarkDotNet/issues/137#issuecomment-216579500

FYI I just just got this exact error with Visual Studio 2015, targetting .NET 4.5.1 and referencing the latest nuget (0.9.5). We're currently referencing 4.5.1 for the time being.

@colgreen could you give it a try with 0.9.6? It has been released an hour ago

Was this page helpful?
0 / 5 - 0 ratings