stryker-mutator / stryker-net

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

Warnings after upgradin to .NET 8.0 #2785

Closed CzBuCHi closed 4 months ago

CzBuCHi commented 7 months ago

Describe the bug On .net 7.0 where wasnt any warnings, after upgrading to 8.0 im getting InvalidOperationException warnings

i think root cause is this one: The analyzer Microsoft.NET.Sdk.Razor.SourceGenerators references a newer version (4.8.0.0) of the compiler than the one used by Stryker.NET.

Logs logs.zip

Expected behavior No warning obviously :)

Desktop (please complete the following information):

Additional context Im using version 3.11.0 due to #2776 bug in 3.12.0 Warnings dont have any effect on stryker - it will happily slauther mutants as before ...

dupdob commented 7 months ago

Thanks for reporting this. I am afraid this is a catch 22 situation here: you need V3.12 to for full Net 8 support. That basically what the warning says. For the time being, Stryker is not able to identify if a referenced code generator will actually generate code. So Stryker always produce a warning when it fails to load a generator/analyzer. So this is the expected behavior for now.

That being said, the warning was improved in V3.11 to provide extra information in order to better understand why the loading fails. Judging by your logs, there are extra failure notifications that are triggered by the first one. I will shortly open a PR for fixing this.

dupdob commented 7 months ago

see #2786