Rank: Advanced Member
Groups: Registered
Joined: 1/24/2016(UTC) Posts: 40 Location: United States of America
Was thanked: 3 time(s) in 3 post(s)
|
We have unit tests for a wide gamut of frameworks, everything from e.g. .NET Framework, .NET Core, and .NET 5. When analysing the .NET 5 builds, the following error is thrown: Code:
An error occurred while analysing this project after it was built: System.MissingMethodException: Method not found: 'System.String System.AppDomainSetup.get_ConfigurationFile()'.
at Xunit.Sdk.XunitTestFrameworkDiscoverer..ctor(IAssemblyInfo assemblyInfo, ISourceInformationProvider sourceProvider, IMessageSink diagnosticMessageSink, IXunitTestCollectionFactory collectionFactory)
at Xunit.Sdk.XunitTestFramework.CreateDiscoverer(IAssemblyInfo assemblyInfo) in C:\Dev\xunit\xunit\src\xunit.execution\Sdk\Frameworks\XunitTestFramework.cs:line 21
at Xunit.Sdk.TestFramework.GetDiscoverer(IAssemblyInfo assemblyInfo) in C:\Dev\xunit\xunit\src\xunit.execution\Sdk\Frameworks\TestFramework.cs:line 71
at Xunit.Sdk.TestFrameworkProxy.GetDiscoverer(IAssemblyInfo assembly) in C:\Dev\xunit\xunit\src\xunit.execution\Sdk\Frameworks\TestFrameworkProxy.cs:line 67
at Xunit.Xunit2Discoverer..ctor(AppDomainSupport appDomainSupport, ISourceInformationProvider sourceInformationProvider, IAssemblyInfo assemblyInfo, String assemblyFileName, String xunitExecutionAssemblyPath, String configFileName, Boolean shadowCopy, String shadowCopyFolder, IMessageSink diagnosticMessageSink, Boolean verifyAssembliesOnDisk) in C:\Dev\xunit\xunit\src\xunit.runner.utility\Frameworks\v2\Xunit2Discoverer.cs:line 106
at Xunit.Xunit2Discoverer..ctor(AppDomainSupport appDomainSupport, ISourceInformationProvider sourceInformationProvider, String assemblyFileName, String configFileName, Boolean shadowCopy, String shadowCopyFolder, IMessageSink diagnosticMessageSink, Boolean verifyAssembliesOnDisk) in C:\Dev\xunit\xunit\src\xunit.runner.utility\Frameworks\v2\Xunit2Discoverer.cs:line 62
at Xunit.Xunit2..ctor(AppDomainSupport appDomainSupport, ISourceInformationProvider sourceInformationProvider, String assemblyFileName, String configFileName, Boolean shadowCopy, String shadowCopyFolder, IMessageSink diagnosticMessageSink, Boolean verifyTestAssemblyExists) in C:\Dev\xunit\xunit\src\xunit.runner.utility\Frameworks\v2\Xunit2.cs:line 41
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.<>c__DisplayClass0_2.<FindTestsForFrameworks>b__1()
at nCrunch.Common.PerformanceTracking.PerfTracker.TrackActivity(String name, Action activity)
at nCrunch.TestExecution.TestFinder.<>c__DisplayClass0_0.<FindTestsForFrameworks>b__0()
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)
This appears to be related to a custom XunitTestFramework that we use to selectively ignore tests using attributes e.g. WindowsOnlyAttribute. Removing all the code from the custom XunitTestFramework still causes the issue. Code:
[assembly: TestFramework(TestFramework.FullName, TestFramework.Assembly)]
...
public class TestFramework : XunitTestFramework
{
public const string FullName = "Blah.TestsCommon.XUnit.TestFramework";
public const string Assembly = "Blah.TestsCommon";
public TestFramework(IMessageSink messageSink) : base(messageSink)
{
}
}
We've been using this custom XunitTestFramework for years with NCrunch and again, the failures only occur when building under .NET 5. The same project targets .NET Core 3.1 and .NET Core 2.1 and is analyzed successfully. Removing the TestFrameworkAttribute does work, but of course, breaks our tests since we have a custom XunitTestFrameworkDiscoverer. Using the latest version of Visual Studio, with the latest .NET 5 SDK's. Also using the most recent version of NCrunch.
|