Hello,
I have an SDK-styled test project (it uses xUnit) which defines the following targets:
XML<PropertyGroup>
<TargetFrameworks>netcoreapp3.1;net452</TargetFrameworks>
</PropertyGroup>
CodeRush's Test Runner used to work just fine with it, until I added .NET 5 as a target:
XML<PropertyGroup>
<TargetFrameworks>net5.0;netcoreapp3.1;net452</TargetFrameworks>
</PropertyGroup>
Now whenever I try to run .NET 5 tests using CodeRush's Test Runner, I get the following output:
CodeSystem.IO.FileNotFoundException: Impossible de charger le fichier ou l'assembly 'System.Runtime, Version=5.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' ou une de ses dépendances. Le fichier spécifié est introuvable.
Nom de fichier : 'System.Runtime, Version=5.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'
à System.ModuleHandle.ResolveMethod(RuntimeModule module, Int32 methodToken, IntPtr* typeInstArgs, Int32 typeInstCount, IntPtr* methodInstArgs, Int32 methodInstCount)
à System.ModuleHandle.ResolveMethodHandleInternalCore(RuntimeModule module, Int32 methodToken, IntPtr[] typeInstantiationContext, Int32 typeInstCount, IntPtr[] methodInstantiationContext, Int32 methodInstCount)
à System.ModuleHandle.ResolveMethodHandleInternal(RuntimeModule module, Int32 methodToken, RuntimeTypeHandle[] typeInstantiationContext, RuntimeTypeHandle[] methodInstantiationContext)
à System.Reflection.CustomAttributeData..ctor(RuntimeModule scope, CustomAttributeRecord caRecord)
à System.Reflection.CustomAttributeData.GetCustomAttributes(RuntimeModule module, Int32 tkTarget)
à System.Reflection.CustomAttributeData.GetCustomAttributesInternal(RuntimeAssembly target)
à Xunit.Sdk.ReflectionAssemblyInfo.GetCustomAttributes(String assemblyQualifiedAttributeTypeName)
à Xunit.Sdk.XunitTestFrameworkDiscoverer..ctor(IAssemblyInfo assemblyInfo, ISourceInformationProvider sourceProvider, IMessageSink diagnosticMessageSink, IXunitTestCollectionFactory collectionFactory)
à Xunit.Sdk.XunitTestFramework.CreateDiscoverer(IAssemblyInfo assemblyInfo)
à Xunit.Sdk.TestFramework.GetDiscoverer(IAssemblyInfo assemblyInfo)
à Xunit.Xunit2Discoverer..ctor(AppDomainSupport appDomainSupport, ISourceInformationProvider sourceInformationProvider, IAssemblyInfo assemblyInfo, String assemblyFileName, String xunitExecutionAssemblyPath, String configFileName, Boolean shadowCopy, String shadowCopyFolder, IMessageSink diagnosticMessageSink, Boolean verifyAssembliesOnDisk)
à Xunit.XunitFrontController.CreateInnerController()
à Xunit.XunitFrontController.get_InnerController()
à Xunit.XunitFrontController.Find(Boolean includeSourceInformation, IMessageSink messageSink, ITestFrameworkDiscoveryOptions discoveryOptions)
à DevExpress.CodeRush.TestRunner.xUnit21.Executor.LoadTests()
Oddly enough, if I remove multi-targeting and use .NET 5 as the sole target, the runner works as expected.
XML<PropertyGroup>
<TargetFramework>net5.0</TargetFramework>
</PropertyGroup>
Of course I cannot use that as a workaround, I do need to validate that my tests runs the same on each of the framework above.
Can you tell what's wrong here? Is it a bug?
Thanks.
Hello David,
Thank you for xml-snippets and the call stack. I have reproduced the problem. Once we fix it, we will notify you in the current ticket.
I can also confirm this error, I just noticed that this error is caused by
DevExpress.CodeRush.TestRunner.xUnit21.Executor.LoadTests()
.If it helps, I'm using
xunit
2.4.1 withxunit.runner.visualstudio
2.4.3Hi Daniel,
Thank you for the information. We will take your configuration into account when working on this issue.