Closed aft-nickolas closed 6 years ago
@aft-nickolas - Thanks for logging the issue. For some reason I was not notified that it was posted.
This seems to be related to the Test Runner used. I can replicate the error when using Visual Studio Test Explorer; when using Resharper, all functions correctly.
The specific issue is Visual Studio Test Runner cannot find a Microsoft DLL -
Microsoft.VisualStudio.TestPlatform.ObjectModel
I am investigating why this occurs.
Ok, this is a bit messy... it seems to have happened somewhere during one of the updates released for Visual Studio 2015, as originally Visual Studio Test Explorer was functioning.
The problem is that xUnit Test Runner seems to have a dependency on:
Microsoft.VisualStudio.TestPlatform.ObjectModel, Version=14.0.0.0
This does ship with Visual Studio 2015, however the Visual Studio Test Explorer cannot find it; this has been reported with both xUnit and NUnit under various scenarios (it seems to work fine with MSTest).
There is not a nuget package with this version available, that I could include to ensure it was located - there are nugets for version 11.0.0.0 and a beta version 15.x.x.x.
Adding a reference (in the project that contains your Tests), to your local copy of Microsoft.VisualStudio.TestPlatform.ObjectModel
is a workaround that will allow you to continue using Visual Studio Test Explorer.
I will keep looking to see if there is a more elegant solution.
This is now functional in Visual Studio 2017, tested using Pro.NBench.xUnit 1.0.4.
Hi,
Is this running on Windows, or Mono on another platform? Windows If you download the example solution, and make no changes, does that execute tests correctly? No
This errors comes from example solution with no changes made. Test Name: Pro.NBench.xUnit.Tests.DictionaryMemoryTests.AddMemory_FailingTest Test FullName: Pro.NBench.xUnit.Tests.DictionaryMemoryTests.AddMemory_FailingTest Test Source: C:\Project\Samples\Pro.NBench.xUnit\Pro.NBench.xUnit.Tests\DictionaryMemoryTests.cs : line 46 Test Outcome: Failed Test Duration: 0:00:00.001
Result StackTrace:b4_0(IEnumerableb 0() in C:\Code\Projects\VS2015\Pro.NBench.xUnit\Pro.NBench.xUnit\XunitExtensions\NBenchTestInvoker.cs:line 71
at System.Threading.Tasks.Task`1.InnerInvoke()
at System.Threading.Tasks.Task.Execute()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Pro.NBench.xUnit.XunitExtensions.NBenchTestInvoker.d__4.MoveNext() in C:\Code\Projects\VS2015\Pro.NBench.xUnit\Pro.NBench.xUnit\XunitExtensions\NBenchTestInvoker.cs:line 71
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
Result Message: System.Reflection.ReflectionTypeLoadException : Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information.
at System.Reflection.RuntimeModule.GetTypes(RuntimeModule module) at System.Reflection.RuntimeAssembly.get_DefinedTypes() at NBench.Sdk.Compiler.ReflectionDiscovery.<>c.
1 types, Assembly assembly) at System.Linq.Enumerable.Aggregate[TSource,TAccumulate](IEnumerable
1 source, TAccumulate seed, Func`3 func) at NBench.Sdk.Compiler.ReflectionDiscovery.LoadAllTypeConfigurators() at NBench.Sdk.Compiler.ReflectionDiscovery.GetConfiguratorTypeForMeasurement(Type measurementType, Assembly specificAssembly) at NBench.Sdk.Compiler.ReflectionDiscovery.GetConfiguratorForMeasurement(Type measurementType, Assembly specificAssembly) at NBench.Sdk.Compiler.ReflectionDiscovery.CreateSettingsForBenchmark(BenchmarkClassMetadata benchmarkClass) at Pro.NBench.xUnit.XunitExtensions.NBenchTestInvoker.RunNBenchTest(Object testClassInstance) in C:\Code\Projects\VS2015\Pro.NBench.xUnit\Pro.NBench.xUnit\XunitExtensions\NBenchTestInvoker.cs:line 150 at Pro.NBench.xUnit.XunitExtensions.NBenchTestInvoker.<>c__DisplayClass4_0.