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
I've defined a couple pipelines and some of them have constraints.
Example:
internal class ValidationPipeline<Request, Response> : IPipelineBehavior<Request, Response>
where Request : IRequest<Response>
where Response : class, ICommandResult
While these pipelines do get executed for the correct arguments (constraints), a System.TypeLoadException error is thrown for Request/Response combinations that violate these constraints. This doesn't break the code, but it does worry me that they show up in the diagnostic tools/logs.
I guess it has something to do with how we register these pipelines?
Not necessary, but feel free to upvote this issue: dotnet/runtime#28033 as the only way today to reliably check generic constraints is to try to close the open type and catch the exception.
I've defined a couple pipelines and some of them have constraints.
Example:
While these pipelines do get executed for the correct arguments (constraints), a System.TypeLoadException error is thrown for Request/Response combinations that violate these constraints. This doesn't break the code, but it does worry me that they show up in the diagnostic tools/logs.
I guess it has something to do with how we register these pipelines?
services.AddScoped(typeof(IPipelineBehavior<,>), typeof(ValidationPipeline<,>));
See also the following issue
Should we modify these pipelines to check our types within the handlers? Would this benefit us at all or is it unnecessary?
The text was updated successfully, but these errors were encountered: