stryker-mutator / stryker-net

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

Microsoft.NET.Sdk.Razor.SourceGenerators.dll could not be loaded. #2736

Closed CzBuCHi closed 6 months ago

CzBuCHi commented 11 months ago

Describe the bug After Initial test run started message im getting this warning: [17:34:51 WRN] Analyzer/Generator assembly C:\Program Files\dotnet\sdk\7.0.402\Sdks\Microsoft.NET.Sdk.Razor\targets..\source-generators\Microsoft.NET.Sdk.Razor.SourceGenerators.dll could not be loaded. Generated source code may be missing.

Warning has no effect on stryker behavior.

Logs logs.zip

Expected behavior No warning / link to page how to resolve.

Desktop (please complete the following information):

Additional context Im not using any source generator in my code.

rouke-broersma commented 11 months ago

You're not using razor in your solution?

CzBuCHi commented 11 months ago

solution is aspnet core minimal api + ef core - no razor files

ryanbell1997 commented 11 months ago

I had this same issue with a completely different project, and all I needed to do to rectify was to update my IDE (VS2022) to the very latest version.

dupdob commented 11 months ago

Thanks for opening this issue, I share your desire for a clearer situation, but there are some caveats, alas: 1) As of today, there is now way for Stryker to identify an analyzer as (1) being (also?) a generator and (2) generating some code. So it is unlikely we can reach a point where this problem is silently ignored, 2) As of today, we have no clue on why an analyzer fails to load, so we are not able to provide useful direction. 3) Next release of Stryker will provide more information (everything Roslyn tells us) about why an analyzer fails to load. We hope this will help resolve individual cases as well as identify fixes and/or general guidance towards this problem