-
Notifications
You must be signed in to change notification settings - Fork 80
Description
We have a solution with mixed C# and C++ projects. Unit testing of C++ is done with mstest, but it appears that the xunit test runner/discoverer is not prepared to find a C++ dll, as the attempt to load it as an assembly throws a BadImageFormatException:
[xUnit.net 00:00:00.2870680] Exception discovering tests from Library.UnitTest.Cpp: System.BadImageFormatException: Could not load file or assembly 'Library.UnitTest.Cpp.dll' or one of its dependencies. An attempt was made to load a program with an incorrect format.
File name: 'Library.UnitTest.Cpp.dll' ---> System.BadImageFormatException: An attempt was made to load a program with an incorrect format. (Exception from HRESULT: 0x8007000B)
at System.Reflection.AssemblyName.nGetFileInformation(String s)
at System.Reflection.AssemblyName.GetAssemblyName(String assemblyFile)
at Xunit.Sdk.ReflectionAssemblyInfo..ctor(String assemblyFileName)$$RethrowMarker$$ at ExceptionExtensions.RethrowWithNoStackTraceLoss(Exception ex)
at Xunit.RemoteAppDomainManager.CreateObjectTObject
at Xunit.Xunit2Discoverer..ctor(ISourceInformationProvider sourceInformationProvider, IAssemblyInfo assemblyInfo, String assemblyFileName, String xunitExecutionAssemblyPath, String configFileName, Boolean shadowCopy, String shadowCopyFolder, IMessageSink diagnosticMessageSink)
at Xunit.Xunit2Discoverer..ctor(ISourceInformationProvider sourceInformationProvider, String assemblyFileName, String configFileName, Boolean shadowCopy, String shadowCopyFolder, IMessageSink diagnosticMessageSink)
at Xunit.Xunit2..ctor(ISourceInformationProvider sourceInformationProvider, String assemblyFileName, String configFileName, Boolean shadowCopy, String shadowCopyFolder, IMessageSink diagnosticMessageSink)
at Xunit.XunitFrontController.CreateInnerController()
at Xunit.XunitFrontController.get_InnerController()
at Xunit.XunitFrontController.get_TargetFramework()
at Xunit.Runner.VisualStudio.TestAdapter.VsTestRunner.DiscoverTestsTVisitor