FastReport Designer - Getting Metadata file 'Microsoft.CSharp' could not be found from Expression
Getting the error "Error CS0006: Metadata file 'Microsoft.CSharp' could not be found" when setting any basic expression for a parameter in the FastReports Designer (.Net Trial version) then trying to user report.Prepare(); in an application.
Am I missing a plugin or just setting the expression wrong? I tested using the most basic [Sqrt(4)] as the expression and run into the failure. When it is blank, the error does not happen
Comments
Resolved this by downgrading the following packages to v2021.4.0:
Hello!
In the Expression property of the parameter itself, the C# expression is written without square brackets — Sqrt(4), not [Sqrt(4)] (square brackets [...] inside Parameter.Expression cause a compilation error; for example:
report.Parameters.Add(new Parameter(‘P1’) { DataType = typeof(double), Expression = ‘Sqrt(4)’ });