You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Apparently, .NET MAUI projects are not supported. (stryker-mutator/stryker-net#3181 (comment))
Is this a known issue?
Are there plans to support it?
Is this documented anywhere?
I've had a little test with Buildalyzer and StrykerBugRepro, it looks like it will build with Buildalyzer, but only if the net9.0 tfm is specified with the TargetFramework property. I'm testing it like this:
varanalyzer=manager.GetProject(path);varenvFactory=newEnvironmentFactory(manager,analyzer.ProjectFile);varbuildEnv=envFactory.GetBuildEnvironment("net9.0",newEnvironmentOptions{GlobalProperties={["TargetFramework"]="net9.0"}// omitting this fails the build});varresults=analyzer.Build(buildEnv!);results.OverallSuccess.ShouldBeTrue();
I'm not sure if Buildalyzer should set this property automatically or if stryker should pass it in, however if I delete the platform specific TFMs from the MAUI app, then stryker gets past the initial build, but now it fails on the mutations compilation with:
Stryker.NET encountered a compile error in .../StrykerBugRepro/StrykerBugRepro/App.xaml.cs (at 5:9) with message: The name 'InitializeComponent' does not exist in the current context (Source code: InitializeComponent)
When Stryker detects a multi-TFM project with a single TFM test project, it should use the test project TFM (passing that to Buildalyzer)
Buildalyzer should probably set the TargetFramework property automatically so that multi-target projects build just the requested TFM
Buildalyzer shouldn't fail for multi-target builds anyway, even though this isn't what you want to build with Stryker, Buildalyzer should not freak out because of an unexpected output for native TFMs. Specifically here I'm seeing the maccatalyst build fail, and I think this is because the build is doing more stuff, like running the linker, but it's partly a design-time build so the linker fails (as there is no built dll), so I think if we want MAUI builds to work seamlessly for all TFMs (which isn't what you want here for Stryker, but could still be useful to someone) then we should have Buildalyzer detect the native TFMs and disable design-time build settings.
That last issue with InitializeComponent needs investigating, I think this might be a Stryker issue (although not sure)
Ok, so I went to add the target framework change I mentioned above (bullet point 2), and it's actually already a thing. There is a Build overload that takes a TFM, so if I do this:
Activity
slang25 commentedon Feb 5, 2025
I've had a little test with Buildalyzer and StrykerBugRepro, it looks like it will build with Buildalyzer, but only if the
net9.0tfm is specified with theTargetFrameworkproperty. I'm testing it like this:I'm not sure if Buildalyzer should set this property automatically or if stryker should pass it in, however if I delete the platform specific TFMs from the MAUI app, then stryker gets past the initial build, but now it fails on the mutations compilation with:
I'm not sure what's happening here to be honest.
slang25 commentedon Feb 5, 2025
So to break this into actionable things:
TargetFrameworkproperty automatically so that multi-target projects build just the requested TFMInitializeComponentneeds investigating, I think this might be a Stryker issue (although not sure)slang25 commentedon Feb 6, 2025
Ok, so I went to add the target framework change I mentioned above (bullet point 2), and it's actually already a thing. There is a
Buildoverload that takes a TFM, so if I do this:it also passes. So this will be a change that Stryker can implement. I'll take a quick look at that now 👀