stryker-net icon indicating copy to clipboard operation
stryker-net copied to clipboard

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

Open CzBuCHi opened this issue 2 years ago • 4 comments

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):

  • OS: Windows 11
  • Type of project: asp.net core
  • Framework Version 7.0
  • Stryker Version: 3.10.0

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

CzBuCHi avatar Oct 18 '23 15:10 CzBuCHi

You're not using razor in your solution?

rouke-broersma avatar Oct 18 '23 16:10 rouke-broersma

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

CzBuCHi avatar Oct 18 '23 17:10 CzBuCHi

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.

ryanbell1997 avatar Oct 20 '23 08:10 ryanbell1997

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

dupdob avatar Oct 20 '23 08:10 dupdob