-
Notifications
You must be signed in to change notification settings - Fork 607
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
FastReport.Utils.CompilerException: '(0,0): Error CS0006: Metadata file 'Microsoft.CSharp' could not be found #377
Comments
I managed to fix this issue by downgrading the version to the same as in the Demo App (2021.4.0.0) and I no longer have the exception |
I have had the same issue with 2022.2.7 and 2022.1.13. I am reluctant to try a much older version and get stuck on it. If I add this line before the Prepare() then the error goes away:
"Labels" is the name of the table inside my data source. I am replacing the data source's data (Json) with:
So the call to RegisterData() would seem to be redundant as the new data has already been pushed into the data source. However without this line the same CS0006 error occurs. Edit: I am using this from a .net 4.8 command line application with a .net Standard 2.0 library. I wonder if it's a consequence of having .net Standard in the mix. |
I use the library: I solved it putting to the same version: |
I have solve this by using target framework: .Net 6 instead of using .Net framework 4.6.2. I had to create a new project and choose the "Windows Forms App" and NOT "Windows Forms App (.NET Framework)" to solve this. |
Yes, testing same report with table object (even empty table) in data band. |
Hi, guys, I am using FastReport Designer to create a report and integrating it into Visual Studio with C#. I am utilizing the VisibleExpression feature in the code to hide a databand if there is no data provided. The expression and preview work fine in the designer, but when I generate it in Visual Studio, I encounter the following error: "FastReport.Utils.CompilerException: '(0,0): Error CS0006: Metadata file 'Microsoft.CSharp' could not be found." I'm not sure how to resolve this issue, as I have already tried various solutions, such as changing NuGet versions, reinstalling packages, and rebuilding the project. Interestingly, whenever I remove the expression, the report generation works without any errors. Additionally, I've noticed that whenever I attempt to use scripts or expressions in Visual Studio, I encounter the same error if there is something the software doesn't like. I would greatly appreciate any assistance you can provide. |
Unfortunately we're not aware of an immediate fix, but this issue is on our radar and will be fixed in the future. |
This appears to be due to the addition of a reference to Microsoft.CSharp in version 2021.4.14. The comment says it was added for dynamic support. It is added even if the The error only seems to occur in reports where the If Microsoft.CSharp is not loaded, then the reference is not able to be found, causing an error to occur. If I add the following code and run it before preparing the report to force Microsoft.CSharp to be loaded into memory, then the error does not occur. vb GetType(Microsoft.CSharp.RuntimeBinder.RuntimeBinderException).GetType() c#
|
Very big thanks. Indeed that is working for me too now. |
I have created a report that works well in the Designer, can be called in the Demo app but can't be incorporated into my application.
I followed the same pattern except I use the "stream" overload for the Report.Load() method and VS throws the exception during the
pdfReport.Prepare()
method. This issue appears similar to #176 which is marked as resolved.A working sample is below:
Output window:
Winforms Application.
.Net 4.7.2
FastReport 2022.1.0.0
The text was updated successfully, but these errors were encountered: