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
{{ message }}
Repository navigation
[Bug] Code generation produces invalid C# string literal for Scrutor-decorated keyed services in 6.0.1 #2895
When using Scrutor's .Decorate<>() to decorate a service registered as ICommandHandler<TCommand, TResponse>, Wolverine 6.0.1 generates invalid C# code during runtime compilation. The generated service key contains an unescaped double-quote character, causing a compilation error at startup.
This worked correctly in 6.0.0.
Steps to Reproduce
1 Register a command handler with Scrutor decoration:
The key "ICommandHandler"2+086d3e55674e4266aa5a200422decbfe+Decorated" is the raw internal key Scrutor generates for the decorated registration. The " inside the string is not escaped to ", breaking the generated C# source.
Expected Behavior: The generated key should be properly escaped:
"ICommandHandler"2+086d3e55674e4266aa5a200422decbfe+Decorated"
Environment:
Wolverine: 6.0.1 (works on 6.0.0)
Scrutor: (decoration via .Decorate<>())
.NET 9
Transport : RabbitMQ (WolverineFx.RabbitMQ)
Workaround
Pinning to 6.0.0 restores the previous behavior. Replacing Scrutor with a manual lambda factory registration also avoids the issue.
@elitonperoni We're not going to be able to support this most likely and you'll need to switch to pure service location. Happy to take pull requests, but I don't see this being something we can just flip a switch on.
FWIW, we could make this work w/ the old Lamar support for Decorators where Lamar inlined the decorator construction. Scrutor does it a hokey way.
And why in the world would you be using something like ICommandHandler<SendBidCommand, SendBidDtoResponse>, SendBidCommandHandler>()within Wolverine? That smells like a homegrown MediatR tool.
Activity
jeremydmiller commentedon May 25, 2026
@elitonperoni We're not going to be able to support this most likely and you'll need to switch to pure service location. Happy to take pull requests, but I don't see this being something we can just flip a switch on.
FWIW, we could make this work w/ the old Lamar support for Decorators where Lamar inlined the decorator construction. Scrutor does it a hokey way.
And why in the world would you be using something like
ICommandHandler<SendBidCommand, SendBidDtoResponse>, SendBidCommandHandler>()within Wolverine? That smells like a homegrown MediatR tool.jeremydmiller commentedon May 25, 2026
Moving this to a discussion because I don't think this is actionable