winforms .NET 6报表设计器系统.运行时.序列化.原语版本6.0.0.0错误

xpszyzbs  于 2023-03-09  发布在  .NET
关注(0)|答案(1)|浏览(191)

我们的项目后端是. Net标准,前端是. Net Framework 4.7.2,我们将我们的C#项目迁移到**. Net 6**。
我们在UI组件上使用了DevExpress工具包。迁移后,虽然WinForm设计器工作正常,但我在报告设计器中遇到了错误。
错误提示System. Runtime. Serialization. Primitives Version www.example.comnot found.当我查看nuget包时,我发现它在4.3.0版本之前就存在了。SDK不应该提供这个包吗?我很困惑。6.0.0.0**not found. When I looked at the nuget packages, I saw that it existed until version 4.3.0. Shouldn't the SDK provide this package? I'm so confused.

    • 堆栈信息:**
1.   Hide Call Stack 
 
at System.ModuleHandle.ResolveType(RuntimeModule module, Int32 typeToken, IntPtr* typeInstArgs, Int32 typeInstCount, IntPtr* methodInstArgs, Int32 methodInstCount, ObjectHandleOnStack type)
at System.ModuleHandle.ResolveTypeHandleInternal(RuntimeModule module, Int32 typeToken, RuntimeTypeHandle[] typeInstantiationContext, RuntimeTypeHandle[] methodInstantiationContext)
at System.Reflection.RuntimeModule.ResolveType(Int32 metadataToken, Type[] genericTypeArguments, Type[] genericMethodArguments)
at System.Reflection.CustomAttribute.FilterCustomAttributeRecord(CustomAttributeRecord caRecord, MetadataImport scope, Assembly& lastAptcaOkAssembly, RuntimeModule decoratedModule, MetadataToken decoratedToken, RuntimeType attributeFilterType, Boolean mustBeInheritable, Object[] attributes, IList derivedAttributes, RuntimeType& attributeType, IRuntimeMethodInfo& ctor, Boolean& ctorHasParameters, Boolean& isVarArg)
at System.Reflection.CustomAttribute.GetCustomAttributes(RuntimeModule decoratedModule, Int32 decoratedMetadataToken, Int32 pcaCount, RuntimeType attributeFilterType, Boolean mustBeInheritable, IList derivedAttributes, Boolean isDecoratedTargetSecurityTransparent)
at System.Reflection.CustomAttribute.GetCustomAttributes(RuntimeType type, RuntimeType caType, Boolean inherit)
at System.ComponentModel.TypeDescriptor.CheckDefaultProvider(Type type)
at System.ComponentModel.TypeDescriptor.NodeFor(Type type, Boolean createDelegator)
at System.ComponentModel.TypeDescriptor.GetDescriptor(Type type, String typeName)
at System.ComponentModel.TypeDescriptor.GetProperties(Type componentType, Attribute[] attributes)
at DevExpress.Data.Browsing.DataBrowserHelperBase.GetListItemPropertiesByType(Type type, PropertyDescriptor[] listAccessors, Int32 startIndex)
at DevExpress.Data.Browsing.DataBrowserHelperBase.GetListItemProperties(Object list, PropertyDescriptor[] listAccessors)
at DevExpress.Data.Browsing.DataBrowserHelper.GetListItemProperties(Object list, PropertyDescriptor[] listAccessors)
at DevExpress.XtraReports.Native.Data.CustomRelatedListBrowser.GetItemProperties()
at DevExpress.Data.Browsing.Design.PropertiesProvider.ToFakedProperties(Object dataSource, String dataMember, PropertyDescriptor[] properties)
at DevExpress.Data.Browsing.Design.PropertiesProvider.ProcessProperties(PropertyDescriptorCollection properties, Object dataSource, String dataMember)
at DevExpress.Data.Browsing.Design.PropertiesProvider.GetItemProperties(Object dataSource, String dataMember, EventHandler`1 action)
at DevExpress.XtraReports.Design.DisplayNameProviderPickManager.GetDataSourceName(Object dataSource, String dataMember, IPropertiesProvider provider, EventHandler`1 callback)
at DevExpress.Data.Browsing.Design.PickManagerBase.<>c__DisplayClass4_0.b__0(IEnumerator enumerator)
at DevExpress.Data.Browsing.Design.ActionExecutor.RunAction()
at DevExpress.Data.Browsing.Design.ActionExecutor.AddAction(Action`1 action)
at DevExpress.Data.Browsing.Design.PickManagerBase.FillContent(IList nodes, Collection`1 dataSources, Boolean addNoneNode)
at DevExpress.XtraReports.Native.TreeListPickManager.FillContent(IList nodes, Collection`1 dataSources, Boolean addNoneNode)
at DevExpress.XtraReports.Native.DataSourceNativeTreeList.UpdateDataSource(IServiceProvider serviceProvider, Object[] dataSources)
at DevExpress.XtraReports.Design.FieldListTreeView.UpdateDataSource(IServiceProvider serviceProvider)
at DevExpress.XtraReports.Design.FieldListController.<>c__DisplayClass28_0.b__0()
at DevExpress.XtraReports.Design.FieldListController.ProcessMessage(Action action)
at System.EventHandler.Invoke(Object sender, EventArgs e)
at System.ComponentModel.Design.DesignerHost.OnLoadComplete(EventArgs e)
at System.ComponentModel.Design.DesignerHost.System.ComponentModel.Design.Serialization.IDesignerLoaderHost.EndLoad(String rootClassName, Boolean successful, ICollection errorCollection)
at System.ComponentModel.Design.Serialization.BasicDesignerLoader.OnEndLoad(Boolean successful, ICollection errors)
at System.ComponentModel.Design.Serialization.CodeDomDesignerLoader.OnEndLoad(Boolean successful, ICollection errors)
at DevExpress.XtraReports.Design.NetCore.CRCodeDesignerLoader.OnEndLoad(Boolean successful, ICollection errors)
at System.ComponentModel.Design.DesignerHost.BeginLoad(DesignerLoader loader)

Nuget软件包管理器:

我重新安装了Dotnet运行时,重新安装了DevExpress工具,手动重新安装了RepxPackage,安装了Runtime.Primitives4.3.0。没有一个是解决方案。

    • 编辑:我添加了新的报告到相同的项目和相同的文件夹,并工作,报告设计器打开。我应该如何修复旧的报告到新的。**

我复制了报告的C#文件和设计师到新的工作报告。那出现。

感谢您提前回答。

ny6fqffe

ny6fqffe1#

我想为那些遇到同样错误的人准备一份指南。
发生此错误的原因是报表设计器(DevExpress工具)不工作或v16.1之后的重大更改。
当您在报表中以任何执行模式在建构函式中呼叫下列程式码区块时,这个错误便会消失。

ScriptPermissionManager.GlobalInstance = new ScriptPermissionManager(ExecutionMode.Deny);

这适用于旧的报表和过时的绑定。我用新的表达式绑定替换了它们。
谢谢。

相关问题