Machine HP Probook 430 G6
Platform Windows 11 Pro Version 23H2
VS2022 Community Edition. Windows Form Application. Targeting .Net 8.0
CR install is SAP Crystal Reports for Visual Studio (SP36) 64b installation package for Microsoft Visual Studio IDE (VS 2022 and above)
Report creates ok and project runs.
Calling the report is done by frm_Load Event of a ‘Report Form’
private void FrmReport_Load(object sender, EventArgs e)
{
try
{
ReportDocument reportDocument = new ReportDocument();\Error Here
reportDocument.Load("rptUserHistory");
}
catch (Exception ex)
{
log.Error(ex);
}
}
Worth Noting that under the Packages tree in solution explorer, the three Crystal Reports packages have information triangles on their icons. Mousing over these shows a message that
these have been restored using a .net hierarchy of 4.6.n instead of project target framework of .Net8.0-windows10.0.22621. This package may not be fully compatible with your project.
Error follows:
2024-07-29 14:54:07,210 [1] ERROR Anthro_Nursing.frmReport – <log4net.Error>Exception >rendering object type [System.TypeLoadException]System.TypeLoadException: >Could not load type ‘System.Web.UI.ParseChildrenAttribute’ from assembly ‘System.Web, >Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a’. at System.ModuleHandle.ResolveType(QCallModule module, Int32 typeToken, IntPtr* >typeInstArgs, Int32 typeInstCount, IntPtr* methodInstArgs, Int32 methodInstCount, >ObjectHandleOnStack type) at System.ModuleHandle.ResolveTypeHandle(Int32 typeToken, RuntimeTypeHandle[] >typeInstantiationContext, RuntimeTypeHandle[] methodInstantiationContext) at System.Reflection.RuntimeModule.ResolveType(Int32 metadataToken, Type[] >genericTypeArguments, Type[] genericMethodArguments) at System.Reflection.CustomAttribute.FilterCustomAttributeRecord(MetadataToken >caCtorToken, MetadataImport& scope, RuntimeModule decoratedModule, MetadataToken >decoratedToken, RuntimeType attributeFilterType, Boolean mustBeInheritable, ListBuilder`1& >derivedAttributes, RuntimeType& attributeType, IRuntimeMethodInfo& ctorWithParameters, >Boolean& isVarArg) at System.Reflection.CustomAttribute.IsCustomAttributeDefined(RuntimeModule >decoratedModule, Int32 decoratedMetadataToken, RuntimeType attributeFilterType, Int32 >attributeCtorToken, Boolean mustBeInheritable) at System.Reflection.CustomAttribute.IsDefined(RuntimeType type, RuntimeType caType, >Boolean inherit) at System.RuntimeType.IsDefined(Type attributeType, Boolean inherit) at System.Diagnostics.StackTrace.ToString(TraceFormat traceFormat, StringBuilder sb) at System.Diagnostics.StackTrace.ToString(TraceFormat traceFormat) at System.Exception.get_StackTrace() at System.Exception.ToString() at log4net.ObjectRenderer.DefaultRenderer.RenderObject(RendererMap rendererMap, Object >obj, TextWriter writer) at log4net.ObjectRenderer.RendererMap.FindAndRender(Object obj, TextWriter writer) </log4net.Error>
Appreciate any tips to overcome the above.