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

Unhandled exception when running against a .NET MAUI project #2238

Open aspeckt-112 opened 1 year ago

aspeckt-112 commented 1 year ago

I apologise if there are any outstanding issues/discussions surrounding this that I've missed. I did look.

Describe the bug I get an unhandled exception when trying run Stryker against a .NET MAUI project. Stryker has previously worked when the same project was targeting Xamarin.Forms.

Logs I've attached a .zip containing the log files.

Expected behavior Stryker should work the same as it previously did with Xamarin Forms.

Desktop (please complete the following information):

Additional context I'm happy to provide a sample project, should the logs not be sufficient. logs.zip

rouke-broersma commented 1 year ago

Hi,

Xamarin and MAUI use some msbuild magic to generate certain files during build. For xamarin we have added some specific support so we get those files. Could be this is done in a different way or looks different for MAUI. Due to that it looks like there are some classes missing from the compilation. Support for MAUI will have to be added.

aspeckt-112 commented 1 year ago

That's totally fair enough. Makes complete sense.

I don't have a huge amount of free time right now, but do you have anything you can point me towards as a "getting started" point? I'd be quite happy to have a go at a PR to add support. I love Stryker, I'd like to keep it part of my workflow, and I'm happy to spend some time trying to make that happen.

OssamaSijbesma commented 1 year ago

I will start working on it! 👀

rouke-broersma commented 1 year ago

@OssamaSijbesma could you note your findings here? And do you still intend to create a PR with the partial fix?

kevmoens commented 1 year ago

I worked around this by moving the core of my code to a separate library project.
I'm not 100% but with the digging I did it looked to be an issue with Buildalyzer nuget not being able to handle MAUI.