FastReport.NET报错 System.PlatformNotSupportedException:“Operation is not supported on this platform.”

作者:C/S框架网|www.csframewo  发布日期:2023/03/20 21:14:30
  FastReport.NET报错 System.PlatformNotSupportedException:“Operation is not supported on this platform.”

VS2022+.NET7 CSFrameworkV6旗舰版踩坑日记:


System.PlatformNotSupportedException:“Operation is not supported on this platform.”






详细信息:

System.PlatformNotSupportedException
  HResult=0x80131539
  Message=Operation is not supported on this platform.
  Source=System.CodeDom
  StackTrace:
   在 Microsoft.CSharp.CSharpCodeGenerator.FromFileBatch(CompilerParameters options, String[] fileNames)
   在 Microsoft.CSharp.CSharpCodeGenerator.FromSourceBatch(CompilerParameters options, String[] sources)
   在 Microsoft.CSharp.CSharpCodeGenerator.System.CodeDom.Compiler.ICodeCompiler.CompileAssemblyFromSourceBatch(CompilerParameters options, String[] sources)
   在 FastReport.Code.AssemblyDescriptor.InternalCompile(CompilerParameters cp, CompilerResults& cr)
   在 FastReport.Code.AssemblyDescriptor.InternalCompile()
   在 FastReport.Code.AssemblyDescriptor.Compile()
   在 FastReport.Report.Prepare(Boolean append)
   在 FastReport.Report.Show()
   在 CSFrameworkV6.ReportModule.FastReportDemo.frmReportSO.DoPreview() 在 E:\Jonnys_Project\CSFramework.V6.0-NET7\CSFrameworkV6.ClientFoundation\CSFrameworkV6.Report\FastReportDemo\frmReportSO.cs 中: 第 41 行
   在 CSFrameworkV6.ReportModule.FastReportDemo.frmBasePrint.btnPreview_ItemClick(Object sender, ItemClickEventArgs e) 在 E:\Jonnys_Project\CSFramework.V6.0-NET7\CSFrameworkV6.ClientFoundation\CSFrameworkV6.Report\FastReportDemo\frmBasePrint.cs 中: 第 18 行
   在 DevExpress.XtraBars.BarItem.OnClick(BarItemLink link)
   在 DevExpress.XtraBars.BarItemLink.OnLinkClick()
   在 DevExpress.XtraBars.BarButtonItemLink.OnLinkAction(BarLinkAction action, Object actionArgs)
   在 DevExpress.XtraBars.ViewInfo.BarSelectionInfo.UnPressLink(BarItemLink link)
   在 DevExpress.XtraBars.Controls.CustomLinksControl.OnMouseUp(MouseEventArgs e)
   在 System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
   在 System.Windows.Forms.Control.WndProc(Message& m)
   在 DevExpress.XtraEditors.XtraControl.WndProc(Message& m)
   在 DevExpress.XtraBars.Controls.CustomControl.WndProc(Message& msg)
   在 DevExpress.XtraBars.Controls.DockedBarControl.WndProc(Message& msg)
   在 System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
   在 System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
   在 System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, WM msg, IntPtr wparam, IntPtr lparam)





注意:重点在 System.CodeDom!由此可见,是报表模版文件有问题。


解决方案


1. 检查报表模版文件里面的字段定义,严格区分大小写!



2. 检查 FastReport.NET版本是否匹配

3. 旧版本的frx文件使用高版本的FastReport,需要使用Designer重新设计模版文件。




FastReport.Net下载安装的版本:



.NET 6

FastReport.Net 2021.3.8


.NET7

FastReport.Net 2021.3.8
FastReport.Net 2023.1.8



C/S框架网|原创精神.创造价值.打造精品



参考文档:

.NETCore WebApi运行报错:System.AggregateException:“Some services are not able to be constructed|C/S开发框架
XtraReport 报错:Report scripts were found in the application while the script execution is disabled.
升级程序DataTable.ReadXml报错:MySql.Data.Types.MySqlDateTime is not allowed here
GIT报错:Could not get HEAD hash. libgit2 returned:repository path "xx" is not owned by current user
MySqlConnector.MySqlException:“Loading local data is disabled|C/S开发框架
Execution Timeout Expired. The timeout period elapsed prior to completion of the operation or the s
SQL:Cannot resolve the collation conflict (字符集冲突)
FastReport.Net报错-正在OS加载器锁定内尝试Managed执行(解决)
FastReport.NET 2023使用DataTable报表数据源配置JsonDataSourceConnection连接|C/S开发框架
FastReport.NET 2023使用DataTable报表数据源配置MsSqlDataConnection连接|C/S开发框架
XtraReport:annot execute report scripts because the application does not include required libraries
FastReport.NET v2021 打印预览报表出错NullReferenceException / RestoreEncodedText,踩坑!
FastReport.NET 动态创建报表FastReport.Report实例绑定List 数据源
OLEDB创建DbConnection连接Excel文件报错:未在本地计算机上注册ACE.OLEDB
WCF:方法SendMessage在此代理中不受支持,如果未使用OperationContractAttribute标记
IIS承载WCF部署报错:未能加载文件或程序集或它的某一个依赖项(但是VS运行正常)