Hi,
I'm getting a strange error after updating some projects to .net10 when I use reqnroll with NCrunch.
The tests run fine in VS test runner and when I use dotnet test, but in NCrunch I get:
Assembly initialize/cleanup failed: System.AggregateException: One or more errors occurred. (One or more errors occurred. (Interface cannot be resolved: Reqnroll.UnitTestProvider.IUnitTestRuntimeProvider('nunit')))
---> System.AggregateException: One or more errors occurred. (Interface cannot be resolved: Reqnroll.UnitTestProvider.IUnitTestRuntimeProvider('nunit'))
---> Reqnroll.BoDi.ObjectContainerException: Interface cannot be resolved: Reqnroll.UnitTestProvider.IUnitTestRuntimeProvider('nunit')
at Reqnroll.BoDi.ObjectContainer.TypeRegistration.<>c__DisplayClass3_0.<ResolvePerContext>b__1()
at Reqnroll.BoDi.ObjectContainer.RegistrationWithStrategy.ExecuteWithLock(Object lockObject, Func`1 getter, Func`1 factory, ResolutionList resolutionPath, TimeSpan timeout)
at Reqnroll.BoDi.ObjectContainer.TypeRegistration.ResolvePerContext(ObjectContainer container, RegistrationKey keyToResolve, ResolutionList resolutionPath)
at Reqnroll.BoDi.ObjectContainer.RegistrationWithStrategy.Resolve(ObjectContainer container, RegistrationKey keyToResolve, ResolutionList resolutionPath)
at Reqnroll.BoDi.ObjectContainer.ResolveObject(RegistrationKey keyToResolve, ResolutionList resolutionPath)
at Reqnroll.BoDi.ObjectContainer.Resolve(Type typeToResolve, ResolutionList resolutionPath, String name)
at Reqnroll.BoDi.ObjectContainer.Resolve(Type typeToResolve, String name)
at Reqnroll.BoDi.ObjectContainer.Resolve[T](String name)
at Reqnroll.Infrastructure.ContainerBuilder.CreateGlobalContainer(Assembly testAssembly, IRuntimeConfigurationProvider configurationProvider)
at Reqnroll.MSTest.ReqnrollPlugin.MsTestContainerBuilder.CreateGlobalContainer(Assembly testAssembly, IRuntimeConfigurationProvider configurationProvider)
at Reqnroll.TestRunnerManager.CreateTestRunnerManager(Assembly testAssembly, IContainerBuilder containerBuilder)
at Reqnroll.TestRunnerManager.<>c__DisplayClass47_0.<GetTestRunnerManager>b__0(Assembly assembly)
at System.Collections.Concurrent.ConcurrentDictionary`2.GetOrAdd(TKey key, Func`2 valueFactory)
at Reqnroll.TestRunnerManager.GetTestRunnerManager(Assembly testAssembly, IContainerBuilder containerBuilder, Boolean createIfMissing)
at Reqnroll.TestRunnerManager.OnTestRunStartAsync(Assembly testAssembly, IContainerBuilder containerBuilder)
at MyCompany_MyNamespace_Acceptance_MSTestAssemblyHooks.AssemblyInitializeAsync(TestContext testContext) in C:\NC\27844\43\src\Acceptance\obj\Debug\net10.0\MSTest.AssemblyHooks.MyCompany_MyNamespace_Acceptance.cs:line 49
--- End of inner exception stack trace ---
at MyCompany_MyNamespace_Acceptance_MSTestAssemblyHooks.AssemblyInitializeAsync(TestContext testContext) in C:\NC\27844\43\src\Acceptance\obj\Debug\net10.0\MSTest.AssemblyHooks.MyCompany_MyNamespace_Acceptance.cs:line 54
--- End of inner exception stack trace ---
at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions)
at System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken)
at System.Threading.Tasks.Task.Wait()
at System.Reflection.MethodBaseInvoker.InterpretedInvoke_Method(Object obj, IntPtr* args)
at System.Reflection.MethodBaseInvoker.InvokeWithNoArgs(Object obj, BindingFlags invokeAttr)
The method must be static, public, does not return a value and should take a single parameter of type TestContext. Additionally, if you are using async-await in method then return-type must be Task.
We are using MSTest as the tests for reqnroll, not nunit.
I've tried adding the mstest provider explicitly to the reqnroll config file and verified that this config file appears in the NCRunch workspace for the test, but it doesn't seem to make any difference.
At .net 8 this all seemed to work, it seems it only at .net 10 that I have an issue
I will try and create a minimal repro solution but wanted to get this out there first