Skip to content

Exception: Assembly with same name is already loaded #3343

@kudima03

Description

@kudima03

Describe the bug
Running mutation testing causes System.IO.FileLoadException: Assembly with same name is already loaded.

Logs
log-20251110.txt

Expected behavior
Mutation testing should complete successfully without compilation errors.

Desktop (please complete the following information):

  • OS: Windows 11
  • Type of project: .NET 9 (ASP.NET Web API + class libraries)
  • Framework Version: .NET 9
  • Stryker Version: 4.8.1

Additional context
Based on the logs, the issue occurs during the mutation phase when Stryker.NET attempts to load analyzer or source generator assemblies from the .NET 9 SDK.
The following warnings appear:

  • Assembly with same name is already loaded
  • The analyzer 'Microsoft.CodeAnalysis.Razor.Compiler' references a newer version (5.0.0.0) of the compiler than the one used by Stryker.NET
  • Errors related to missing interceptors in generated ASP.NET Core code (Microsoft.AspNetCore.Http.RequestDelegateGenerator)

It seems Stryker.NET 4.8.1 is using an older Roslyn compiler version that is not fully compatible with the new source generator and interceptor features introduced in .NET 9.

Metadata

Metadata

Assignees

No one assigned

    Labels

    🐛 BugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions