CS8785: Generator 'MediatorGenerator' failed to generate source.
See original GitHub issueI have a request that implements IRequest<byte[]>.
public class ExportRequest : IRequest<byte[]>
{
}
I have a request handler that implements IRequestHandler<ExportRequest, byte[]>.
public class ExportRequestHandler : IRequestHandler<ExportRequest, byte[]>
{
// implementation
}
I get a CS8785 warning and no code is generated for the ExportRequestHandler. I have several other request, command and notification handlers, but this is the only one that expected to return a byte array result.
Also, the warning message is complaining: "Exception of type ‘FileNotFoundException’ with message 'Could not load file or assembly ‘System.Runtime.CompilerServices.Unsafe, Version=6.0.0.0. blah blah blah’ or one of its dependencies.
Are there any restrictions on TResponse types?
the project that I am using this on is a .Net6.0 project in VS 2022.
Code generation fails for any array type but succeeds for everything else. Tried string[], int[], Stream[].
using version 1.0.5
Issue Analytics
- State:
- Created a year ago
- Comments:7 (3 by maintainers)

Top Related StackOverflow Question
right now it is working fine.
If I create the code for an IRequest class, I just have to remember to at least start the shell for the corresponding IRequestHandler.
Will try it out.
Thanks for looking into this.
please keep up the good work.