stryker-mutator / stryker-net

Mutation testing for .NET core and .NET framework!
https://stryker-mutator.io
Apache License 2.0
1.76k stars 175 forks source link

Stryker.NET throws Unhandled exception. System.IO.FileNotFoundException #2157

Closed Lutti1988 closed 10 months ago

Lutti1988 commented 1 year ago

Describe the bug Stryker runs into problem, whenever I try to run it in an azure devops build pipeline. The following output is produced with the command dotnet stryker --project "MyProject" --solution "MySolution.sln" --reporter "progress" --reporter "json" within the unit test project folder. Weird is, that the DLLs are searched in project/bin/debug/net6.0/ref/ instead of project/obj/debug/net6.0/ref/ , because there is no "ref" folder in bin/debug/x

Logs Output: image

Expected behavior The DLLs should be searched in the correct folder.

Desktop (please complete the following information): Azure DevOps Server 2020 Update 1.1 - .NET 6.0 - dotnet-stryker 2.2.0

Additional context On my local machine (Windows 10 - .NET 6.0 - dotnet-stryker 2.2.0) everything works fine.

rouke-broersma commented 1 year ago

As far as I can tell that is your unit test failing to resolve it's dependency. What happens if you run dotnet test and dotnet vstest on that testproject? Also, passing the solution file should not be necessary for a dotnet 6 project when ran from the unit test folder. Could you try running without specifying the solution file?

Lutti1988 commented 1 year ago

Removing the solution file parameter does not change anything. Same result. dotnet test result: image

dotnet vstest result: image

Is there maybe a problem with projects referencing other projects? I have a Project-A, a Project-A-UnitTest and a Project-B. Project-A has Project-B as a reference.

rouke-broersma commented 1 year ago

Other projects as references are not a problem, especially not when you specify which project to test explicitly.

richardwerkman commented 1 year ago

@Lutti1988 is this still an issue in the latest version?

dupdob commented 10 months ago

assumed issue is fixed