Using .Net Core 3.0
ToDataSourceResult raises an exception if the DataSourceRequest has Aggregates
the exception says that there is no constructor with the following signature:
Void Microsoft.CodeAnalysis.CSharp.CSharpCompilationOptions(
Microsoft.CodeAnalysis.OutputKind,
Boolean,
String,
String,
String,
Collections.Generic.IEnumerable`1<String>,
Microsoft.CodeAnalysis.OptimizationLevel,
Boolean,
Boolean,
String,
String,
Collections.Immutable.ImmutableArray`1<Byte>,
Nullable`1<Boolean>,
Microsoft.CodeAnalysis.Platform,
Microsoft.CodeAnalysis.ReportDiagnostic,
Int32,
IEnumerable<KeyValuePair<String,Microsoft.CodeAnalysis.ReportDiagnostic>>,
Boolean,
Boolean,
Microsoft.CodeAnalysis.XmlReferenceResolver,
Microsoft.CodeAnalysis.SourceReferenceResolver,
Microsoft.CodeAnalysis.MetadataReferenceResolver,
Microsoft.CodeAnalysis.AssemblyIdentityComparer,
Microsoft.CodeAnalysis.StrongNameProvider,
Boolean,
Microsoft.CodeAnalysis.MetadataImportOptions,
Microsoft.CodeAnalysis.CSharp.NullableContextOptions
)
I traced the error down to the method that causes it :
CSharpCompilation CreateCompilation(SyntaxTree syntaxTree)