'Running C# .NetCore with XUnit in Jenkins without the DLL

I recently took over a automation project that was written in .NetCore 3.1 using XUnit/Selenium. The Project that houses the code is a console application, not a class library so DLL of the tests are not created. I've had experience getting JAVA Maven based into Jenkins and running each tests a a standalone build in Jenkins but with this C# version, I am not sure how to proceed. All of their automation is in one Project of the solution, broken down to cs files with a Class in each one hold all the FACT/THEORY Tests. With .Net Framework, you can target the dll of each test to run it but in this case, I cannot see how to do this without the DLL. They essentially want to target the test Class in each file and run it as a build in Jenkins.

Is this even possible or do we need to convert it to a Class Library to get it to work in Jenkins? The company does NOT want to change it to a Class Library if that can be done.

I know that they will need to install MSTest and the plugin Active Choice Parameter to target their appsettings.json file as well.



Solution 1:[1]

Try to change <OutputType>Library</OutputType> to your test project .cproj file

My example for net5.0

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 shatulsky