stryker-net icon indicating copy to clipboard operation
stryker-net copied to clipboard

Problem with referenced Razor pages: 'Stryker.NET could not compile the project after mutation.'

Open johanwintgens-ls opened this issue 2 years ago • 1 comments

Describe the bug Stryker runs into problems whenever I try to unleash it on my Solution. I have tried to exclude the problem files/project both in the config file and in the dotnet stryker command, to no avail. The following output is produced with the command dotnet stryker --solution "C:\Users\johan.wintgens\source\repos\Lansweeper.IT\src\Lansweeper.IT.sln" -m "!**/CloudOverviewBase.cs" -m "!**/LinkToCloudBase.cs" -m "!**/SensorsBase.cs" -m "!**/*.razor", but I've also tried "!**/Lansweeper.IT.Hub/**/*.*" and tried lots of things via config and via cmd params, but none of that seems to work. Also, passing the solution path via config only seems to work for me when I use the full path, but in the documentation it looks like it should work with relative paths...

Logs Output: image Config right now: image

Expected behavior Either compile after mutation, or respect the exclusions given

Desktop (please complete the following information): Windows 10 - VS22 - ASP.NET - .NET 6.0 - dotnet-stryker 2.1.2

Additional context The 'types' that are not found are actually Razor pages, which seems to be the problem. At this point I would just like to exclude the whole Lansweeper.IT.Hub project, but I can't seem to get around it.

johanwintgens-ls avatar Aug 19 '22 14:08 johanwintgens-ls

Solution runs are currently not functional. I cannot recommend that you try this. Instead, run stryker from either the test project or the project under test (while specifying which test project to use). When you run stryker this way the project containing razor pages should not be included.

rouke-broersma avatar Aug 19 '22 15:08 rouke-broersma