【发布时间】:2021-01-19 03:36:41
【问题描述】:
我已经安装了 Visual Studio 2010、dotnetframework 4.0 和 SAP CrystalReport 13。
但我在 IIS 上运行网站:
“/”应用程序中的服务器错误。找不到方法:'无效 System.Runtime.InteropServices.Marshal.StructureToPtr(!!0, IntPtr, 布尔值)'。描述:在执行过程中发生了未处理的异常 执行当前的 Web 请求。请查看堆栈跟踪 有关错误及其起源的更多信息 代码。
异常详细信息:System.MissingMethodException:找不到方法: '无效 System.Runtime.InteropServices.Marshal.StructureToPtr(!!0, IntPtr, Boolean)'。
来源错误:
在执行过程中产生了一个未处理的异常 当前的网络请求。有关原产地和位置的信息 可以使用下面的异常堆栈跟踪来识别异常。
堆栈跟踪:
[MissingMethodException:找不到方法:'无效 System.Runtime.InteropServices.Marshal.StructureToPtr(!!0, IntPtr, 布尔值)'。]
CrystalDecisions.ReportAppServer.DataSetConversion.DataSetConverter.Wrap(对象 数据集,CrdbAdoPlusDelegate& adoPlusDelegate) +0
CrystalDecisions.CrystalReports.Engine.Table.WrapAndCacheDotNetObject(对象 val,类型类型,ISCRAdoNetDataSet& crAdoNetDataSet) +240
CrystalDecisions.CrystalReports.Engine.Table.SetDataSource(对象 val, 类型类型)+344
CrystalDecisions.CrystalReports.Engine.ReportDocument.SetDataSourceInternal(对象 val,类型类型)+142
CrystalDecisions.CrystalReports.Engine.ReportDocument.SetDataSource(DataTable dataTable) +66 ReportView.Page_Load(Object sender, EventArgs e) +46720 System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp,对象 o,对象 t,EventArgs e)+14
System.Web.Util.CalliEventHandlerDelegateProxy.Callback(对象发送者, EventArgs e) +35 System.Web.UI.Control.OnLoad(EventArgs e) +91
System.Web.UI.Control.LoadRecursive() +74
System.Web.UI.Page.ProcessRequestMain(布尔值 includeStagesBeforeAsyncPoint,布尔型 includeStagesAfterAsyncPoint) +2207
请帮助我!谢谢。
【问题讨论】:
-
这可能不是您的问题,但是您为什么要使用这些过时的软件和框架?
-
Marshal.StructureToPtr自 .Net 4.5.1 起就在框架中。这使得之前的评论更相关。是时候更新了。 -
因为我公司使用这个程序,我不能更新
-
您不需要更新 Crystal Reports,但确实需要更新 .NET 框架,因为问题正是 CP 正在调用当前版本中不存在的方法框架。更新到the most recent 4.x version your system supports,即使是非常旧的系统也支持比 4.0 更新的东西。
标签: c#