Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stryker.NET could not compile the project after mutation - MAUI #3215

Open
AaronBastian opened this issue Mar 13, 2025 · 1 comment
Open
Labels
🐛 Bug Something isn't working

Comments

@AaronBastian
Copy link

Describe the bug
After the project mutation in a MAUI app, framework level calls such as InitializeComponent become unrecognized.

Logs
Stryker.NET encountered a compile error in StrykerTest/StrykerTest/App.xaml.cs (at 6:2) with message: The name 'InitializeComponent' does not exist in the current context (Source code: InitializeComponent)
Safe Mode! Stryker will flag mutations in App as compile error.
Stryker.NET could not compile the project after mutation. This is probably an error for Stryker.NET and not your project. Please report this issue on github with the previous error message.

Expected behavior
The MAUI app will continue to compile after mutations are run. MAUI specific methods, such as InitializeComponent will remain recognized after mutations.

Desktop (please complete the following information):

  • OS: MacOS 15.1.1
  • Type of project: MAUI
  • Framework Version: net8.0
  • Stryker Version: 4.5.1

Additional context
I spent time struggling to get a MAUI app to pass analysis because the TargetFramework configuration option was ignored in the IProjectAnalyzer.Build() method. So I checked out the code, modified the analyzer to pass in the configured TargetFramework, and got past that step where mutations would actually run. This is the only set of code changes that I made.

@AaronBastian AaronBastian added the 🐛 Bug Something isn't working label Mar 13, 2025
@AaronBastian AaronBastian changed the title Stryker.NET could not Stryker.NET could not compile the project after mutation - MAUI Mar 13, 2025
@dupdob
Copy link
Member

dupdob commented Mar 14, 2025

I spent time struggling to get a MAUI app to pass analysis because the TargetFramework configuration option was ignored in the IProjectAnalyzer.Build() method. So I checked out the code, modified the analyzer to pass in the configured TargetFramework, and got past that step where mutations would actually run. This is the only set of code changes that I made.

Regarding this, a proper fix is in PR #3184.

That being said, we know that Stryker is not able to build MAUI project and we do not know why yet.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 Bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants