Rank: Member
Groups: Registered
Joined: 8/3/2012(UTC) Posts: 22
Thanks: 2 times Was thanked: 6 time(s) in 6 post(s)
|
I have a .NET Core 2.0 project (target .NET Framework 4.7) that contains xunit v2.2 tests for an ASP.NET Core 2.0 project in the same solution. When NCrunch tries to build the project an InvalidCastException gets thrown: Code: An error occurred while analysing this project after it was built: System.InvalidCastException: Unable to cast object of type 'Xunit.Sdk.ReflectionAssemblyInfo' to type 'Xunit.Abstractions.IAssemblyInfo'. at Xunit.AppDomainManager_NoAppDomain.CreateObject[TObject](AssemblyName assemblyName, String typeName, Object[] args) at Xunit.Xunit2Discoverer..ctor(AppDomainSupport appDomainSupport, ISourceInformationProvider sourceInformationProvider, IAssemblyInfo assemblyInfo, String assemblyFileName, String xunitExecutionAssemblyPath, String configFileName, Boolean shadowCopy, String shadowCopyFolder, IMessageSink diagnosticMessageSink, Boolean verifyAssembliesOnDisk) at nCrunch.Module.XUnit2.Integration.XUnitTestFrameworkContainer.GetDynamicFramework(FilePath assemblyFilePath, DirectoryPath workingDirectory) at nCrunch.Module.XUnit2.Integration.XUnit2DiscoveryEnvironment.<>c__DisplayClass2_0.<FindFrameworkTestsInAssembly>b__1() at nCrunch.Common.PerformanceTracking.PerfTracker.TrackActivity(String name, Action activity) at nCrunch.Common.PerformanceTracking.PerfTracker.TryTrackActivity(String name, Action activity) at nCrunch.Module.XUnit2.Integration.XUnit2DiscoveryEnvironment.FindFrameworkTestsInAssembly(ReflectedAssembly assembly, FilePath assemblyFilePath, IList`1 referencedAssemblyFilePaths, ComponentUniqueName testComponentUniqueName, PlatformType platformType, DynamicProxy[] dynamicProxies) at nCrunch.TestExecution.TestFinder..() at nCrunch.Common.PerformanceTracking.PerfTracker.TrackActivity(String name, Action activity) at nCrunch.TestExecution.TestFinder..() at nCrunch.Common.PerformanceTracking.PerfTracker.TrackActivity(String name, Action activity) at nCrunch.TestExecution.TestFinder.FindTestsForFrameworks(ReflectedAssembly assembly, FilePath assemblyFilePath, IList`1 referencedAssemblyFilePaths, DescribedTestFrameworkDiscoverer[] describedDiscoverers, ComponentUniqueName testComponentUniqueName, PlatformType platformType, DynamicProxy[] dynamicProxies) at nCrunch.TestExecution.RemoteTaskRunner.AnalyseAssembly(DescribedTestFrameworkDiscoverer[] applicableFrameworks, ComponentUniqueName testComponentUniqueName, PerfTracker perfTracker)
I have both "Pre-load all assembly references into test environment" and "Copy referenced assemblies to workspace" set to "true" for the test project.
|